How to Add Header in HTML
Hi! So, my blog for today is about "how to add header in HTML".
These are the Steps:
These are the Steps:
- Start by adding the text content to your HTML in between your
<header></header>tags:<header> <p>Hi, I'm</p> <h1>Tati!</h1> </header>You should be able to see this in your browser if you refresh the page. - Let's center your header text. To get the elements in your header positioned correctly, you're going to need to use CSS. To target specific parts of the CSS you're going to use the "class" attribute in your HTML file.Add the following code to index.html file:
<header class="masthead"> <p class="masthead-intro">Hi,I'm</p> <h1 class="masthead-heading">Tati!</h1> </header>
The header tag now has a "class" attribute equal to "masthead". The word "masthead" is nothing special. You could have chosen any word to be our class attribute. "Masthead" is commonly used for headers with big background images like this.
- Create a new file called "style.css" in your folder and add the following code to it.
body { background-color:blue; }We are temporarily making your background blue so that in the next step you can tell if you've linked your css file correctly! - Next we'll link your CSS file to your html file. Add the following line of code to your index.html file in between the
<head></head>tags.<head> <title> My Website </title> <link rel="stylesheet" type="text/css" href="style.css"> </head>
Save your files and refresh your browser. Your page should have a colored background! If not go over the steps one more time. One common mistake is placing your css file (style.css) in a different folder than your html file. Make sure they are in the same folder.
SAMPLE OUTPUT:

Thanks for Visiting!
This comment has been removed by the author.
ReplyDeleteNice choice of topic :)
ReplyDeleteNICE BLOG!!!������
ReplyDeleteNICE BLOG!!!������
ReplyDeleteOohhh
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis is a great blog. kudos to the author.
ReplyDeletewow nice blog
ReplyDeleteNice blog
ReplyDeleteSoooo interesting!! ππ
ReplyDeletewow these are amazing! THANKS FOR THIS BLOG
ReplyDeleteSwegπππ
ReplyDeleteGood Topic
ReplyDeleteWOWW!!
ReplyDeleteNICE BLOG!!
ReplyDeleteWowmazing blog!!
ReplyDeleteAmazing!
ReplyDeleteSo interesting!
ReplyDeleteWoww daebak!
ReplyDeleteamazing
ReplyDeleteso interesting
ReplyDeletenice one
ReplyDeleteWow! This blog is amazing!
ReplyDeleteInteresting
ReplyDeleteWooooooow
ReplyDeleteWonderful
ReplyDeleteSo niceee
ReplyDeleteSo amazing ππ
ReplyDeleteInteresting!!!
ReplyDeleteThanks for th info!
ReplyDeleteIt's very helpful
ReplyDeleteVery helpful blog! Thanks!
ReplyDeleteNice blog! Its very helpful
ReplyDelete