Forum Moderators: not2easy
I can remove the gap above and below the header using margin-top and margin-bottom but I'm not sure how to get it to appear on the same row as other text.
Assuming that the capitals represent my header I can achieve this :-
.... and it is still
RAINING IN WALES
but the forecast is good ....
but I want to achieve this :-
.... and it is still RAINING IN WALES but the forecast is good ....
Another subject but I suppose Google hates this :)
<p class="inline">.... and it is still </p>
<h6 class="inline">RAINING IN WALES </h6>
<p class="inline">but the forecast is good .... </p>
There's even an official way to do that, but it doesn't work in most browsers: See [w3.org ] and check "display:run-in"
<p class="inline">.... and it is still </p>
<h6 class="inline">RAINING IN WALES </h6>
<p class="inline">but the forecast is good .... </p>
Just leave a gap between "still" and the closing </p> and a gap between "WALES" and the closing </h6>.
BTW: you also might want to consider styling the header like this:
h6{text-transform:uppercase;}
and the write the code like this:
<h6 class="inline">raining in Wales </h6>
That would add some extra accessibility, I guess, because the "uppercasing" is only a visual thing.
JohnnyWales, can I ask if there's a reason it needs to be a <H#> tag...as from what I know (not much really! :)) I'm under the impression that this is not the "correct" use of an <H> tag...
what you're trying to do can be achieved quite easily with a span class within a normal paragraph...
css:
.hilite {
font-size: 0.8em;
font-weight: bold;
text-transform: uppercase;
}
HTML:
<p>.... and it is still <span class="hilite">raining in wales</span> but the forecast is good .... </p>
apologies if this is not what you're after..but interested to know
Suzy
:)
Logically an H tag marks the header for content that follows it - but not for the preceding content. That holds true no matter how you set the visual rendering rules.
So, depending on the content involved, I'd say this might be a "correct" use of the H tag. But I'd be very careful about how you execute. A run-in head can be very useful, but using the H tag for phrases that have both preceding text and following text seems odd to me.
Certainly, don't pepper the page with these run-in H tags around every one of your keywords. If everything's in an H tag, it can be like NOTHING's in an H tag. The best bet is to use H tags to highlight the page's logical structure.
However, H tags are for Headings. They are used to map out the structure of your web page.
Check this link replacing your web address into the foo.com part:
[validator.w3.org...]
Note that %3A is the colon : and that %2F is the slash / and these are required.
My original intention was to try and benefit from the perceived advantage for <H1> on my key phrases without seeing any difference when viewing the page.
I think this all gets back to the three most important aspects of SEO - content, content, and content.
If you plan your content carefully - with thought to SEO - you will be able to use those H1 tags appropriately, and not as the tag equivalent of hidden text.
We do use CSS to maintain control of the size of the tag - standard H1 is way larger than anything we normally use - but it can be worked in as the header to the main body of text. So if your keywords are appropriate as the headline on the page, you can easily use H1. If your keywords are NOT appropriate as part of the page headline, maybe a little re-write is in order.
It does making planning a page a little more difficult - but I think you will find the effort worthwhile.