-3

I spent several hours searching for an answer to my question but didn't find anything similar. I have completed web with a lot of design. Now I noticed that I didn't use H1 tag on any page and will want to add H1 tag on navigation titles.

So my question is,

How can I make H1 tag to not have any effects, just to be a normal tag in HTML without style effect on the text?

Ashwini Mohan
  • 71
  • 3
  • 9
Flegy
  • 47
  • 13

3 Answers3

4

Use all: unset; to remove default browser style(then you can set your style if you want to...)

h1{
 all: unset;
}
<h1>I am h1 but looks like normal p</h1>

Edit support in IE

Your alternative is to override browser default style with !important

here is links to default style in each browser

For example override IE style:

h1{
font-size: 11pt;
font-weight: normal;
}
 <h1>I am h1 but looks like normal p</h1>
 
 <p>this is the default style:</p>
 display: block;
font-size: 24pt;
font-weight: bold;
margin: 14pt 0;
לבני מלכה
  • 15,925
  • 2
  • 23
  • 47
  • thanks, it did a trick, but I had to add !important at the end. But how to do same for Edge/Internet Explorer? – Flegy Dec 18 '18 at 06:26
0

Reassign the h1 tags style as you declared for other tags. h1{font-size:20px !important;.....}

Joyson
  • 370
  • 4
  • 18
0

you can use h1 tag for main headings and customize it according to your requirement. Like:-

h1{font-size: 24px;}
Sarabjit Singh
  • 611
  • 7
  • 17