homepage Welcome to WebmasterWorld Guest from 54.145.183.169
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
<h1></h1> tags
ArmanSuleimenov

5+ Year Member



 
Msg#: 11536 posted 12:33 pm on Dec 25, 2005 (gmt 0)

Now all the titles of articles on my site have the following properties: font: bold 27px 'Tahoma'; color: #2A2A92. How can I insert the titles of these pages between <h1></h1> tags so that the properties described above do not change? The fragment of html-code to modify:

<style type="text/css">
<!--
.ts1 {font: bold 27px 'Tahoma'; color: #2A2A92}
-->
</style>
<span class="ts1">The title of the article</span>

Can you explain me what to do?

 

Span

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 11536 posted 12:49 pm on Dec 25, 2005 (gmt 0)

Something like this, maybe?


h1 {
margin:0;
padding:0;
font:bold 27px tahoma,verdana,sans-serif;
color:#2a2a92;
}

<h1>The title of the article</h1>

kiwibrit

10+ Year Member



 
Msg#: 11536 posted 2:33 pm on Dec 25, 2005 (gmt 0)

Why specify margin and padding as 0 for a <h1>?

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 11536 posted 4:03 pm on Dec 25, 2005 (gmt 0)

In the above example, you can also just replace span with h1:

<h1 class="ts1">The title of the article</h1>

If you don't want the line break at all, then add display:inline to the rules.

Why specify margin and padding as 0 for a <h1>?

I often do that (well, I usually prefer a 4px margin) to avoid the sizeable gap between the header and the body copy. It gives a certain look that I prefer on many pages, visually associating the head and the copy more closely. This also makes for a bit more content above the fold.

kiwibrit

10+ Year Member



 
Msg#: 11536 posted 4:42 pm on Dec 25, 2005 (gmt 0)

tedster, OK. FWIW, I am using

margin-top: 0;
margin-bottom: 0;
margin-left: .5em;

mostly at the moment - suits a lot of stuff I do right now. I just wondered if your settings had to do with an IE quirks thing that I didn't know about.

Happy Christmas to you.

ArmanSuleimenov

5+ Year Member



 
Msg#: 11536 posted 7:32 am on Dec 26, 2005 (gmt 0)

Thank you. Now how can I replace
<span class="ts1">The title of the article</span> with <h1>The title of the article</h1> in DW for all pages on my site? Keep in mind that the articles' titles are different on different pages.
tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 11536 posted 3:43 pm on Dec 26, 2005 (gmt 0)

How about doing it in two steps -- one batch replace for all the opening tags and then on for all the closing tags.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved