Hi,
I would like to make a <h1> and <h2> style rule to obtain the effect voor my headers as can be seen here: http://www.ecstechnics.com/modules/page.phtml?dimensionid=17&pageid=23
The main header style rule (<h1>) I can make easily I think: just apply the correct font style and that is it.
But for the <h2> header, I need a colored line that extends the width of my liquid main content container, except if it is interfered by a floating image. Example on the same site: http://www.ecstechnics.com/modules/page.phtml?dimensionid=24&pageid=37
The line extends for a certain width (preferably that of my liquid container, if not a fixed width), but if an image or other object interferes, I would like it to shorten correspondingly.
Is that possible? Any hints please?
Thank you!!
Erik
You could use something like this...
h2 {
font-size: 18px;
font-weight: normal;
color: #666;
margin-bottom: 2px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #B90000;
}
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
CSS:
.short {
border-bottom: 1px solid red;
width: 400px;
}
.wide {
border-bottom: 1px solid red;
width: 100%
}
HTML:
<h2 class="short">This is short</h2>
<h2 class="wide">This is wide</h2>
Does this help?
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
From what I read, there is no way for the line under the header to automatically adjust according to the available space...
Not necessarily. The H1 and H2 tags are block-level tags which automatically expand/shrink to fill the space available, so I think all you need is the border-bottom.
You should open the page that you want to emulate in a browser and then use View > Page Source (in Firefox) to see how they did it.
HTH,
Randy
Oh great!!
Good to read this.
So <h1> and <h2> are block level tags; <h3> and further are not block level tags?
I already changed the styles and will be experimenting today. Checking this other site I refered to above http://www.ecstechnics.com/modules/page.phtml?dimensionid=17&pageid=23 I find they use tables (horrible!) and for the underlined title a <p class="contentarticletitle"> type styling is used. Not exactly what I want to do.
Experimenting with this rule gives following problem:
When making an image float to the left, and writing an <h2> tag next to it makes the line defined in bottom-border go thru (underneath) the image floated left IF I use the .short tag. Using the .wide tage just makes the whole line wide, thru the image. This is using this style on a <h2> tag.
The only difference between the .short and the .wide is the line length specification: the first is a fixed number of px, the second is 100%
I want the <h2> tag with fixed line length to float to the right of an image at the left.
How can I solve this?
You could add a margin. This example assumes the floated image is 400px wide and give it 20px gutter space.
.short {
border-bottom: 1px solid red;
width: 400px;
margin: 0 0 0 420px;
}
To have the bottom border extend all the way to the right of its container, just delete the width property.
--
Mark A. Boyd
Keep-On-Learnin' :-)
North America
Europe, Middle East and Africa
Asia Pacific