Search
Your Options
Footer
But I get the following output:
Search
Your Options
Footer
I get a line or white space between each section. Can anyone tell me
where I am going wrong?
Thanks
<pre>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/
xhtml1-transitional.dtd">
<html><head><title>Left Nav Bar Test</title>
<style type="text/css">
body {
margin: 0px 0px 0px 0px;
font-family: arial, verdana, tahoma, sans-serif;
font-size: 12px;
text-align: left;
background-color: #efefff;
}
#contentleft {
width: 162px;
float: left;
}
.frameheader {
background-color: yellow;
}
.framebody {
background-color: white;
}
.framefooter {
background-color: red;
}
h1 {
font-size: 12px;
}
</style>
</head>
<body>
<div id="contentleft">
<div class="frameheader">
<h1>Search</h1>
</div>
<div class="framebody">
<h1>Your Options</h1>
</div>
<div class="framefooter">
<h1>footer</h1>
</div>
</div>
<br clear="all" />
</body>
</html>
</pre>
I think the space you describe has probably got more to do with the default
rendering of h1 by browsers...
You could try modifying your css so that:
h1 {
font-size: 12px;
margin:0; <-- new bit
}
> <div id="contentleft">
> <div class="frameheader">
> <h1>Search</h1>
> </div>
>
> <div class="framebody">
> <h1>Your Options</h1>
> </div>
>
> <div class="framefooter">
> <h1>footer</h1>
> </div>
> </div>
It's a margins setting as you have been told, but how can your page have
*more than one* level one header?
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Thanks a lot because I have had that little aggravation for some time,
and I patched it with a div and background to match.
a-ok-site
> charlbury wrote:
>> Hi, I'm having trouble with CSS white space. With the code at the
>> bottom of this post I expect the following output:
>
>> <div id="contentleft">
>> <div class="frameheader">
>> <h1>Search</h1>
>> </div>
>>
>> <div class="framebody">
>> <h1>Your Options</h1>
>> </div>
>>
>> <div class="framefooter">
>> <h1>footer</h1>
>> </div>
>> </div>
>
> It's a margins setting as you have been told, but how can your page have
> *more than one* level one header?
because I told it to, dipshit.
The header is nothing more than a fixed font size. No rules say you can use
it only once.
Excuse me? No, a heading is a *heading* not a header, and it does have
semantic meaning, I guess you had trouble with outlines when you did
your research papers in school, eh?
H# elements are used for the hierarchal headings in a document, and
should not be used to format the font size of some text. That is what
CSS is for...
.special { font-size: 1.5em; font-weight: bold; ... }
Even if headings are supposed to be strictly hierarchical, you could
still have two top level headings in a document-- just two trees of
headings side by side. You would need another rule like XML's
requirement of having exactly one root element per document.
> Sorry, the code above does not have the <pre> and </pre> tags around
> it. I though I needed this to post the unformatted html.
<blink><font color=red size=7>What are you babbling about?</font></blink>
You should quote or paraphrase what you are commenting on, even when you
comment on yourself.
You should not apologize for lack of <pre> and </pre> tags since they should
not be included and would not help anything. You should apologize for not
including a URL.
<marquee><font color=red size=7>If your newsreader interprets HTML markup in
Usenet messages, it needs to be fixed or replaced
<i>now</i>.</font></marquee>
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
> Hi, I'm having trouble with CSS white space.
Stop worrying about that. Learn the elements of the basics of HTML first.
> font-family: arial, verdana, tahoma, sans-serif;
> font-size: 12px;
And later, read a decent tutorial on CSS before creating the usual crap of
thoughtless CSS code. Anyone who has read such a tutorial knows from the two
lines above that it makes little sense to try to help you with CSS issues
before you are willing to forget what you thought you knew about it and
start actually _learning_ how to use CSS.
DOH.....first post link was cut off....grrrr
W3C CSS Validator Results for
> "start actually _learning_ how to use CSS."
LMAO......Maybe, validate before making a statement like previous!!!
> DOH.....first post link was cut off....grrrr
Don't worry, you already ridiculed yourself in public. No wonder you write
anonymously.
People like you are why I hate groups. Just because something else
was going on and I was not paying attention DOES NOT MEAN I RIDICULED
MYSELF: however, you did! About the anonymous crap, I am one of the
few that actually has a real profile. Do you.... From the way people
have acted since I joined this group, and not just towards me, I can
live without it.
> .. I am one of the few that actually has a real profile.
That sounds like a Google Group thing...
This isn't Google Groups, you know, it's Usenet, and all we need is a
news reader and a news service. ;-)
--
-bts
-Motorcycles defy gravity; cars just suck
>> > DOH.....first post link was cut off....grrrr
>>
>> Don't worry, you already ridiculed yourself in public. No wonder you
>> write anonymously.
>>
>> --
>> Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
>
> People like you are why I hate groups.
Even The Doobie Brothers?
> Just because something else
> was going on and I was not paying attention DOES NOT MEAN I RIDICULED
> MYSELF: however, you did! About the anonymous crap, I am one of the
> few that actually has a real profile. Do you....
Probably when he turns sideways to the light source....
> From the way people
> have acted since I joined this group, and not just towards me, I can
> live without it.
Whinny kids do not exactly enhance my living experience, either.
--
Bone Ur
Cavemen have formidable pheromones.
> Even if headings are supposed to be strictly hierarchical, you could
> still have two top level headings in a document-- just two trees of
> headings side by side.
Something like...
h1. Cats & Dogs
h2. Cats
h3. Siamese cats
h3. Tabby cats
h2. Dogs
h3. Greyhounds
h3. Beagles
h1. Fish
h2. Sharks
h3. Hammerhead sharks
h2. Cod
h2. Sardines
But one could argue that the two h1-level headings should in fact be h2:
h1{display:none}. Good Pets to Keep
h2. Cats & Dogs
h3. Cats
h4. Siamese cats
h4. Tabby cats
h3. Dogs
h4. Greyhounds
h4. Beagles
h2. Fish
h3. Sharks
h4. Hammerhead sharks
h3. Cod
h3. Sardines
That is, there can only be one <title> element for the page, so there
should only ever be one <h1> element, which should roughly correspond with
it. (It is often useful to include context information in the title, such
as the name of the collection of documents to which this document belongs.)
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 11 days, 19:36.]
[Now Playing: ./counting_crows/millers_angels_demo.ogg.]
I agree with this that there should be only on H1 per page, but the HTML
Gods will not strike you dead if you using more than one (but if you do
it should make logical sense) What I object to is the use of H# to
"style" with. In other words using H# where the text is not a heading
but where the author merely wants bigger bolder text!
> Toby A Inkster wrote:
> > Ben C wrote:
> >
> >> Even if headings are supposed to be strictly hierarchical, you could
> >> still have two top level headings in a document-- just two trees of
> >> headings side by side.
> >
<example of two h1 trees...>
> > That is, there can only be one <title> element for the page, so there
> > should only ever be one <h1> element, which should roughly correspond with
> > it. (It is often useful to include context information in the title, such
> > as the name of the collection of documents to which this document belongs.)
> >
>
> I agree with this that there should be only on H1 per page, but the HTML
> Gods will not strike you dead if you using more than one (but if you do
> it should make logical sense) What I object to is the use of H# to
> "style" with. In other words using H# where the text is not a heading
> but where the author merely wants bigger bolder text!
Yes, to use it to get the font-size you want for a bit of text is
altogther wrong. But back to the question of the headings as
logical structure, it depends on the material in the page whether
you argue one way or another, to stick to 'only one h1 per page'
is a policy decision that is good for the most part. There is the
question whether it is always needed to use an h1, it could be
implied by the context, it may not need to be stated, the page
goes straight to h2s and down for different strands under the
unstated h1. (I think that possibility is what Toby was implying
by his h1 {display: none}".
On the other hand, it could be that his example is a little too
favourable to the "only one h1 per page" policy. You can be
struck by the reference of the page itself to guide you, in which
you will always find an h1 (stated or implied) or you can be
guided by the material under the heading, and you want a really
meaningful heading for it, no less than an h1 doing it justice.
--
dorayme
> unstated h1. (I think that possibility is what Toby was implying
> by his h1 {display: none}".
I meant to imply that the h1 is there for semantic and structural reasons,
but CSS is used to hide it.
It may be that the main heading is obvious to all who come to the page, so
there is no benefit in showing it to the visitor, yet I still think there
should be a main heading, even if you hide it with CSS for those reasons.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 12 days, 6:20.]
USD/EUR Exchange Rate Graph
http://tobyinkster.co.uk/blog/2007/11/18/usd-eur/
> dorayme wrote:
>
> > unstated h1. (I think that possibility is what Toby was implying
> > by his h1 {display: none}".
>
> I meant to imply that the h1 is there for semantic and structural reasons,
> but CSS is used to hide it.
>
> It may be that the main heading is obvious to all who come to the page, so
> there is no benefit in showing it to the visitor, yet I still think there
> should be a main heading, even if you hide it with CSS for those reasons.
It is something I have been thinking for a while and have now and
then just had h2s or two or more h1s for very separate sections
of a page. I either worried that there was no h1 or too many!
But, of course, you can or should stick it in but not necessarily
display it. Thanks for drawing attention to this possibility.
--
dorayme
No - thank YOU.
> Even if headings are supposed to be strictly hierarchical, you could
> still have two top level headings in a document
I've not checked this in the standard, but I don't believe so.
Under W3C HTML (the only real sort) there's no restriction on
hierarchy or ordering of <h*> at all. Do whatever you like.
Under the bizarre aberrant ISO HTML (which I intend to ignore rather
than dissecting), the require both strict hierarchies _and_ a single
<h1> as a root.
So it's either very loose, or very strict. There's nothing in the
middle where hierarchy is required but multiple roots are also
permitted.
Are you sure? From https://www.cs.tcd.ie/15445/15445.html#DTD:
<!ELEMENT BODY - O (%block;|H1|H2|H3|H4|H5|H6)+ +(DEL|INS) >
Doesn't that mean the BODY must contain one _or more_ of a block or a
H#?
So
<body>
<h1></h1>
<h1></h1>
</body>
would be valid.
Just because the it will parse does not necessary mean that it makes
sense. You could put your address in an ACRONYM element, or your site
navigation links in definition list DT. It can validate as valid HTML
but it wouldn't make semantic sense.
> Are you sure?
No, as I said. I haven't checked this, I have no intention of spending
the time to do so. The whole standard is a pointless abomination.
> From https://www.cs.tcd.ie/15445/15445.html#DTD:
I don't believe that it's the DTD that expresses these constraints,
but rather the supporting text. However I don't know section numbers
or web links to it.