Placing text in a background header

image with text in html
text over image bootstrap
background image with text overlay
how to write text on image in html with example
text over image css responsive
html text over image without css
make text readable over image css
bootstrap 4 overlay text on image

I have a bigger HTML header containing a menu and a large picture.

I would like to place text on the image somewhere as a "title" to the page.

Whenever I try to add my <h1> tag somewhere, it positions the text above the menu and it's not what I want.

I would like to be able to position any form of tags somewhere in the picture and I am struggling to find a solution as my code is not efficient to do this.

I am starting to understand what my problem is but I cannot find a solution.

Here is a template of what's going on. I want to place the text somewhere next to my face (as weird as it sounds lol), anyone?

body {
  font: 15px/1.5 Gravity, Arial;
  padding: 0;
  margin: 0;
}

header {
  width: 100%;
  height: 800px;
  background: url('../img/web_bg.jpg');
  background-size: cover;
}

.logo {
  line-height: 60px;
  position: fixed;
  float: left;
  margin: 16px 46px;
  color: #000;
  font-weight: bold;
  font-size: 20px;
  letter-spacing: 2px;
}

nav {
  z-index: 100;
  position: fixed;
  width: 100%;
  line-height: 60px;
}

nav ul {
  line-height: 60px;
  list-style: none;
  background: rgba(0, 0, 0, 0);
  overflow: hidden;
  color: #fff;
  padding: 0;
  text-align: right;
  margin: 0;
  padding-right: 40px;
  transition: 1s;
}

nav.black ul {
  background: #fff;
  z-index: 100;
}

nav ul li {
  display: inline-block;
  padding: 16px 40px;
  ;
}

nav ul li a {
  text-decoration: none;
  color: #000;
  font-size: 16px;
}

nav ul li a:hover {
  background-color: #white;
  border: none;
  color: #000;
  text-align: center;
  opacity: 0.6;
}

.menu-icon {
  line-height: 60px;
  width: 100%;
  background: #000;
  text-align: right;
  box-sizing: border-box;
  padding: 15px 24px;
  cursor: pointer;
  color: #fff;
  display: none;
}
<header id="home">
  <h1>MOHANAD ARAFE</h1>
  <nav>
    <div class="menu-icon">
      <i class="fa fa-bars fa-2x"></i>
    </div>
    <div class="logo">MOHANAD ARAFE</div>
    <div class="menu">
      <ul>
        <li><a href="#home">Home</a></li>
        <li><a href="#portfolio">Portfolio</a></li>
        <li><a href="#contact">Contact</a></li>
      </ul>
    </div>
  </nav>
</header>

You are going good, cheers for that. For the problem you are facing I would suggest you to play with z-index. It is a CSS property, and defines the elements as layers. Element with greater z-index will be the top most layers, followed by the elements with lesser z-index. I would suggest you to set z-indec of image to lowest, and make the content above in another container, and set the z-index of this container to a higher range, this should solve your problem.

Here's more reference on z-index

Happy Coding.

CSS - How can I make a font readable over any color?, How do you put a background image in a header in HTML? Learn how to place text over an image. To learn more about how to style images, read our CSS Images tutorial. To learn more about CSS positoning, read our CSS Position tutorial.

I would suggest using grid in these kind of situations where you have to deal with position of elements. A crash course on grid will be the best option. I personally use it a lot and don't have to care about anything other than z index.

Design Considerations: Text on Images, How do you put a background image on text in HTML? I'm attempting to place my logo right next to my text in the header of my webpage. I have played around with the 's but the best I can do is have the logo sit on top of the test. How can I fix this

You can use position: absolute; for the h1 tag and use top value in %, and left value in %

h1{
  position:absolute; 
  top: value in %;
  left: value in %;
  }
header{
   position:relative;      
  }

Note: apply a class name for h1 and apply css for that class or else it might affect h1 tag in sub pages.

Placing text in a background header, In it, his Rule 4 is: Learn the methods of overlaying text on images. I. background-attachment: fixed; overflow: hidden; } .module > header { position: absolute;  Method 2: Insert a Text Box into Header or Footer Firstly, double click on header to enter editing mode. Next click "Insert", "Text Box" and "Draw Text Box" in consecutive. See your cursor turns into a plus sign. And click to draw a text box as large as the header area. Repeat step 5 to 10 in

Try by giving position: absolute to the header and then position: relative to the children. Hope this will help you.

How To Position Text Over an Image, Placing text in a background header - html. body { font: 15px/1.5 Gravity, Arial; padding: 0; margin: 0; } header { width: 100%; height: 800px; background: url('. Positioning a picture in the document header/footer, floating in front of text, AND in front of a table in main document where cell is shaded I'm having trouble making an image in a page header/footer appear in FRONT of main body text, when the main body text is a table with background shading for the top row.

insert text to header picture, How To Place Text in Image. Step 1) Add HTML: Example. <div class="container"​> How To Put a Background Image in the Divi Header Josh Hall. Loading Unsubscribe from Josh Hall? How to Create a Fullwidth 2 Column Image & Text Section in Divi + Free Layout - Duration: 9

Putting background image in header - CSS, As I want a specific text only for the main page I used the following code: <h1>​header text</h1> featured background image and Location “Front  If you want to disable the text wrap entirely, you can select the object (the picture or background frame or whatever), choose Window > Text Wrap, and click the first button. Alternatively, you can tell InDesign that this particular text frame (the one you want to put over the image/background) should not be affected by text wrap.

Adding text to banners – Squarespace Help, to figure out how to put an image as a background in the header area font-​family: Georgia; color: #a50909; text-align: center; background:  Learn how to place text blocks over an image. To learn more about how to style images, read our CSS Images tutorial. To learn more about CSS positoning, read our CSS Position tutorial. Your message has been sent to W3Schools. W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic

Comments
  • Can you explain the problem specifying what elements of the code are you talking about?
  • Hi, this seems to work but I am having a problem with the responsive side of things. When I decrease the size of the window, the text moves all over the place due to % values.
  • you need to change % values in media queries for mobile devices, tutorialrepublic.com/css-tutorial/css3-media-queries.php