homepage Welcome to WebmasterWorld Guest from 54.166.53.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

This 69 message thread spans 3 pages: < < 69 ( 1 [2] 3 > >     
Using the <footer> and <address> Tags on a Webpage
gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 7:02 pm on Nov 30, 2013 (gmt 0)

I am currently working on a website that is going to have one page at first, so I am planning on including the physical address of the business in the body text after the last paragraph.

I think that it would be okay to write the address inside a <footer> tag, but I would appreciate if you could tell me if this would be okay?

The next thing that I am thinking about is how to write the address inside the <footer> tag, and I think writing it inside an <address> tag would be a good way to do this. Would this be okay?

I believe that the answer to the 2 questions below would be yes, but I wanted to get your thoughts?

(1) Is it okay to include the phone number in the <address> tag?

(2) Can I include a sentence such as "This is our address:" in the <address> tag in addition to the address itself? If I can, can this sentence be within a <p> tag inside an <address> tag?

Example

<footer>
<address>
<p>This is our address:<p>
XYZ Company<br />
123 Pine Drive<br />
City, State 11111<br />
<br />
Phone: (111) 234-5678
</address>
</footer>

I have read that the words inside an <address> tag are italicized. Does this mean that what is in the <p> tag will also be italicized? Is there a way to un-italicize what is in the address tag, both what is in the <p> tag and the address itself that is not in the <p> tag but within the <address> tag?

These days, one thing that I am seeing businesses do is make a companyís phone number into a link so that it can be clicked on in a smartphone to dial the number. I believe that they are using something like <a href="tel:1112345678">Call (111) 234-5678 today.</a> to do this. I am not using responsive web design on this site. It is a desktop version and that is what someone will see on a smartphone. On a site such as this, would a visitor be able to click on the phone number and dial the number on a smartphone, or do you need responsive website design to do this? Also, will what I have written appear okay if the site is viewed on a desktop? Will Call (111) 234-5678 today. appear as plain text or a link? Will there be any display problems in terms of maybe the sentence not showing up at all on a desktop?

I also saw this in one place so I wanted to ask. Can each line of the address be put inside a <line> tag? Is there such a thing?

It would look like the following:

<footer>
<address>
<p>This is our address:<p>
<line>XYZ Company</line>
<line>123 Pine Drive</line>
<line>City, State 11111</line><br />
<br />
Phone: (111) 234-5678
</address>
</footer>

One more thing that I thought about as I wrote this post is the mentioning of the phone number. Is it possible to mention the phone number of a business too many times on a webpage and/or website? I am planning on including it in the meta description, h1 tag and once in the body text as I have mentioned in my example above. Would this be okay?

I apologize for all the questions. I have not really worked on sites for businesses before, and your thoughts would really help to guide me.

 

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 11:25 pm on Dec 19, 2013 (gmt 0)

mattur,

So you can just use <!DOCTYPE html> instead, if you want your pages to validate, but it will have no effect whatsover on what features actually work in the browser :)

Thanks for the suggestion on how I should write the DOCTYPE. Since I am using a template, I will have to go with what they use. If they make a change, then maybe <!DOCTYPE html> will be what I see.

drhowarddrfine

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 5:09 am on Dec 20, 2013 (gmt 0)

XHTML is dead as a dodo and has been for years.
And, again, I will educate you that you are flat out wrong.

the doctype declaration is a legacy from the SGML days, its only function is to switch browsers into standards-mode for CSS layout features.
This statement is also false. The doctype, as used on HTML web pages, was created for IE only due to its lack of proper standards support though its roots are in the SGML doctype declarations. It in no way resembles what SGML did/does. Nor is intended for CSS usage.
The doctype you use has no effect on HTML elements supported in the browser. Browsers just ignore it and use the same HTML5 parser they use for all HTML pages.
Ignoring the fact that they go into quirks mode without one and you never want to be in quirks.
lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4626921 posted 6:38 am on Dec 20, 2013 (gmt 0)

the doctype declaration is a legacy from the SGML days, its only function is to switch browsers into standards-mode for CSS layout features.

The doctype you use has no effect on HTML elements supported in the browser. Browsers just ignore it and use the same HTML5 parser they use for all HTML pages.

Useful synopsis, thanks. I looked up the HTML 5 DTD recently and learned that "html" (alone) is the absolute minimum required to prevent middle-aged browsers from going into quirks mode. If it weren't for that, there would be no particular need for a DTD at all.

So you can just use <!DOCTYPE html> instead, if you want your pages to validate, but it will have no effect whatsover on what features actually work in the browser

A handful of tags are flat-out gone in html 5, so they will raise validation issues. Obviously no loss in the case of <font>, but I'm a little annoyed about <tt>.

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 1:14 pm on Dec 20, 2013 (gmt 0)

If I have a DOCTYPE that isn't

<!DOCTYPE html>

because the template doesn't use it, and the DOCTYPE is more like

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

can I use HTML 5? In the DOCTYPE that I mention, html is mentioned.

swa66

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



 
Msg#: 4626921 posted 2:40 pm on Dec 20, 2013 (gmt 0)

HTML5 (and XHTML5) use
<!DOCTYPE html>

without any additions.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

is a promise to adhere to the mentioned DTD, you should not use anything specific to html5.

But you could/should upgrade your template...
Transitional xhtml 1.0 is really outdated, would be one of the first things to go if I touched a site that still used it.

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 5:58 pm on Dec 20, 2013 (gmt 0)

swa66,

is a promise to adhere to the mentioned DTD, you should not use anything specific to html5.

If I use

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

does this mean that I shouldn't use HTML5 or I can't use HTML5?

Is it possible that I can use HTML 5 with this DOCTYPE and the page won't validate in W3 but viewers will be able to see the content in their browser?

Maybe the template will be upgraded in the future.

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4626921 posted 7:29 pm on Dec 20, 2013 (gmt 0)

drhowarddrfine:
the doctype declaration is a legacy from the SGML days, its only function is to switch browsers into standards-mode for CSS layout features.
This statement is also false. The doctype, as used on HTML web pages, was created for IE only due to its lack of proper standards support though its roots are in the SGML doctype declarations. It in no way resembles what SGML did/does. Nor is intended for CSS usage.

HTML was based on SGML from the beginning. The Doctype declaration existed in HTML [w3.org] before IE even existed, it certainly wasn't created for IE(!). <!doctype html> was only retained in HTML5 because this was the minimum rubric we could get away with while still triggering standards layout mode [developer.mozilla.org] for "CSS usage" in browsers, as Lucy24 pointed out above.

You can read more about the history of Doctype switching here: [w3.org...]

The doctype you use has no effect on HTML elements supported in the browser. Browsers just ignore it and use the same HTML5 parser they use for all HTML pages.
Ignoring the fact that they go into quirks mode without one and you never want to be in quirks.

The doctype affects the CSS layout mode not the elements supported in the browser, as my post quoted in your reply and highlighted above, points out. Don't waste my time please.

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4626921 posted 7:46 pm on Dec 20, 2013 (gmt 0)

gouri:
When you use this doctype on a normal web page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

This is what browsers see:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

That is, browsers just see the bits in bold and ignore all the SGML and XML bits:

<!DOCTYPE html><html>

The doctype you use does not have any effect whatsoever on what html tags will work in the browser. So viewers with modern browsers will still see your content, it just won't validate.

Note that for for viewers using IE8 and below, you need to use the html5shiv to force IE to recognise the new HTML elements: [en.wikipedia.org...]

swa66

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



 
Msg#: 4626921 posted 9:13 pm on Dec 20, 2013 (gmt 0)

Mattur: that's balony, and I suspect you know, or else it's a huge over-simplification.
E.g. Try adding even something as innocent as a BOM and some browsers fall all over themselves.

Now it's clear what your stance is and it's clear we will never ever agree.

FWIW: browsers do react differently if served xhtml as xml - very much so. Not only are they faster, they refuse some crappy code in javascript but also they point out mistakes in your code right there.

What you are advocating is not having strong rules on the authors and that's going to be the downfall of it all. We absolutely need strict rules on authors of content and let the consumers of said content be open in what they parse. That way you create a robust system - it was part of the original html spec as far as I can remember -I read it back then - didn't bother to find it recently.
Unfortunately, the openness of the consumers has been abused to no end by browser makers (esp. so during the browser wars) and authors alike that there is now but one way out of the mess: force the clients to be strict in what they parse so the authors have no choice but to clean up their act.

That forcing can be done. E.g. Google could get all the slackers in gear with one simple rumor. I'm afraid they won't, but they could. And if the crap out there gets worse, who knows: they might start to prefer standards adhering code, or code adhering to stricter standards. No I'm not betting on it, t's not why I do what I do, I want the clean code for myself.

Gouri: you should not, if you like to risk things you probably can - you can serve anything the real question is going to be will all current and future clients parse it properly and how can you ever test them all. I don't own all phones, tablets, all game consoles, all versions of FF, Safari, Opera, ... nor do I have the time to test it on all of them.
But as soon as it goes "should not" I don't really care if it works or not - I'll never use it as I'm doing my best to get valid well structured (not always in the xml meaning, but mostly, that too) code out in public.

I care a lot about the long term and to me that means valid code. I've made concessions in the past and regretted it each and every time - sometimes years later, but I know I should never have let it slide.
Never again: valid code and I'd rather have a short term visible error than something that comes to haunt me years from now.

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4626921 posted 11:59 pm on Dec 20, 2013 (gmt 0)

The HTML5 doctype was chosen because it matches the bits legacy UAs were already matching on to switch into standards mode. That's the only reason it exists.

[whatwg.org...]

This, and all the horrendous legacy SGML and XML workarounds required to parse existing content are of course specified in the HTML spec in excruciating detail, eg:

[whatwg.org...]

Authors can safely avoid all this pointless complexity by just publishing normal html pages with <!DOCTYPE html> at the top.

aristotle

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



 
Msg#: 4626921 posted 10:52 pm on Dec 21, 2013 (gmt 0)

gouri wrote:
If I use

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

does this mean that I shouldn't use HTML5 or I can't use HTML5?

You should convert the template to html5, then stick to html5 coding too. Then everything will be consistent and coherent for brwosers and search engines.

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 1:55 am on Dec 22, 2013 (gmt 0)

When you say convert the template to HTML5, do you mean changing the DOCTYPE from what it is to <!DOCTYPE html> or do you mean something else?

If you mean changing the DOCTYPE, would I be able to do that or do I have to go with what the DOCTYPE of the template is?

aristotle

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



 
Msg#: 4626921 posted 10:58 am on Dec 22, 2013 (gmt 0)

When you say convert the template to HTML5, do you mean changing the DOCTYPE from what it is to <!DOCTYPE html>

Yes that would be the first step. Whether you need to do anything else depends on the specifics of the template. Most likely you can find out what else you might need to do by creating a test page and running it through the two validators:

[validator.w3.org...] and [jigsaw.w3.org...]

Edit: P.S. I've never actually done this kind of conversion, so not sure what problems might turn up. But another option is to create your own template from scratch. That's what I've always done, but my pages are simple static html. For anything more complicated I would try to find a ready-made template somewhere.

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4626921 posted 12:52 pm on Dec 22, 2013 (gmt 0)

If you mean changing the DOCTYPE, would I be able to do that or do I have to go with what the DOCTYPE of the template is?

Just change the start of your template from:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

to:

<!DOCTYPE html><html>

And you are good to go :)

Browsers are already treating your template as if you are using the HTML5 doctype. The only difference resulting from this change will be validators will no longer report errors for any HTML5 tags you use in your page. Browsers will not be affected at all.

You don't need to pay any attention to long cargo-cult doctypes or configuring XHTML content-types. Just publish normal HTML pages with this doctype like Google, Wikipedia, Facebook, Twitter, etc are all already doing. It's completely safe to do this, and it saves typing out all the "/W3C//DTD XHTML... blah blah" stuff which doesn't actually do anything anyway.

aristotle

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



 
Msg#: 4626921 posted 2:17 pm on Dec 22, 2013 (gmt 0)

<!DOCTYPE html><html>


Do you really need the second <html>?

I don't have it in my pages and they still validate without it.

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4626921 posted 2:24 pm on Dec 22, 2013 (gmt 0)

Strictly speaking it's not needed, but I included it so the snippet is just a simple, copy-and-paste, direct replacement for what Gouri is currently using.

(feel free to start another thread if you want to discuss optional tags in more detail)

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4626921 posted 9:33 pm on Dec 22, 2013 (gmt 0)

The two "html" are unrelated things. The first is part of the doctype. The second is part of the wrapper for the entire page: <html> at the very beginning, </html> at the very end.

I once discovered by accident that if you leave off the closing </body> and </html> the file will still validate-- at least in html 4. But that certainly doesn't mean you should do it!

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 3:32 am on Dec 23, 2013 (gmt 0)

I first wanted to say thank you to all of you for describing how to change the DOCTYPE and the explanations about how the browsers are interpreting the coding of a page. Also, thanks for the links, Aristotle.

I cannot make changes in the head section of a page and I think that this is where the DOCTYPE declaration is made, so I am not sure that I would be able to change the DOCTYPE. Am I right about this or would I be able to change the DOCTYPE?

I have read that CMS and templates sometimes use XHTML, although I am not sure why that is. Maybe that's why there is a XHTML DOCTYPE?

Is it possible to request a web host to change the DOCTYPE?

JD_Toims

WebmasterWorld Senior Member Top Contributors Of The Month



 
Msg#: 4626921 posted 4:16 am on Dec 23, 2013 (gmt 0)

I cannot make changes in the head section of a page and I think that this is where the DOCTYPE declaration is made, so I am not sure that I would be able to change the DOCTYPE. Am I right about this or would I be able to change the DOCTYPE?

Technically, if you're in control of the server presenting the template, you can, but it's a bit cumbersome and definitely a work-around if you don't have complete control over the template coding, because in that situation the change would have to be "server-side script" [eg PHP] based.

aristotle

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



 
Msg#: 4626921 posted 12:16 pm on Dec 23, 2013 (gmt 0)

I cannot make changes in the head section of a page and I think that this is where the DOCTYPE declaration is made, so I am not sure that I would be able to change the DOCTYPE. Am I right about this or would I be able to change the DOCTYPE?

I don't understand your situation. Do you mean that you can't upload your own pages to the server?

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 5:06 pm on Dec 23, 2013 (gmt 0)

JD_Toims,

Technically, if you're in control of the server presenting the template, you can, but it's a bit cumbersome and definitely a work-around if you don't have complete control over the template coding, because in that situation the change would have to be "server-side script" [eg PHP] based.

I don't think that I am in control of the server; it is shared hosting. If it is shared hosting, can I change the DOCTYPE?

aristotle,

I don't understand your situation. Do you mean that you can't upload your own pages to the server?

Yes, I don't think that I can upload pages to the server. I think that they have to be created in the hosting account.

I can upload images and then include them on a page, but I think that uploading images might be different from uploading pages?

If I can't upload pages on to the server, does that mean that I can't change the DOCTYPE?

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4626921 posted 5:18 pm on Dec 23, 2013 (gmt 0)

If it is shared hosting, can I change the DOCTYPE?

Unless you have the worst host in the world, yes, you can change everything. Now, if you're using a CMS, normally you will never see the raw html. It's created for you. You can still open up your files and look at them, but the CMS takes care of all the nuts-and-bolts. That includes everything that would normally go in a document's <head> section.

I don't think that I can upload pages to the server. I think that they have to be created in the hosting account.

Oh, oops, you do have the worst host in the world :(

In a decent shared-hosting setup, the only difference between you and the guy with his own server is that you can't edit the config file so all rules have to go in htaccess. Everything else should be the same: full upload privileges (ftp or similar), full access to raw logs, ability to create e-mail addresses and so on.

aristotle

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



 
Msg#: 4626921 posted 7:48 pm on Dec 23, 2013 (gmt 0)

If you can upload images, you certainly should be able to upload other types fo files such as pages in the same way.

Also, When you said you're using a template, do you mean a CMS? Even if you are, on a small site it might be practical to get the CMS-generated source code, then change the Doctype or anything else you want to change, then upload and overwrite the original CMS-generated page.

aristotle

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



 
Msg#: 4626921 posted 7:59 pm on Dec 23, 2013 (gmt 0)

Lucy wrote:
The two "html" are unrelated things. The first is part of the doctype. The second is part of the wrapper for the entire page: <html> at the very beginning, </html> at the very end.

Thanks for explaining that. I had thought that the html5 Doctype declaration automatically implied an html5 document. Anyway, I've started adding the "extra" <html> to the top of my pages for better conformance.

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 5:23 pm on Dec 31, 2013 (gmt 0)

aristotle,

Also, When you said you're using a template, do you mean a CMS?

I think it is a template. It is not something like WordPress or Drupal, which I believe is what is considered a CMS?

---------------------

Another question I had if you guys could help me with it:

I was doing research about quirks mode and standards mode and was wondering how much of a difference will there be in the appearance of a page if the browser goes into quirks mode? I read that even if there is one tag that is used that is not part of a certain DTD, the browser goes into quirks mode. An example would be having XHTML as your DTD and using <br> instead of <br />. <br />, I believe, is what should be used with XHTML. I would like to use HTML5 elements, but I donít think that I can change the DOCTYPE. I do realize that a <br> tag probably doesn't have the same weight as, for example, a <header>, <footer> or <section> tag, but the concept of the tag not being what is used with a particular DOCTYPE holds true for this as well.

I also read that what is generally affected when a browser goes from standards mode to quirks mode is the CSS styling. Would it be okay to use the <header>, <footer>, <section>, and <aside> elements if I donít style them with CSS? I will style the elements inside of these tags. For example, I will style the H2 tag, paragraphs, and bullet points that appear inside a <section> tag with CSS instead of the <section> tag itself.

drhowarddrfine

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 3:54 am on Jan 1, 2014 (gmt 0)

There are significant changes to how a page is displayed in quirks but it does not matter. You should never be in quirks mode.
I read that even if there is one tag that is used that is not part of a certain DTD, the browser goes into quirks mode.

The doctype is what sets standards mode. With IE, if you have anything in front of the doctype, including whitespace or any kind of junk, it goes into quirks. Otherwise, using a proper doctype will take you out of quirks and nothing else.
An example would be having XHTML as your DTD and using <br> instead of <br />. <br />, I believe, is what should be used with XHTML.
If you aren't serving your page as application/xml+xhtml, then you are serving broken HTML and browsers will treat it as such. And I almost guarantee you are not serving XHTML but "tag soup".

When a browser is in quirks, it uses a broken box model where margins and padding are misplaced.

It's been a long time since I've given any thought to how a browser would react to invalid elements because I don't do that but try it and see what happens. However, we already know IE<9 doesn't know what the new elements are and won't let you style them.

One thing people don't think about is that the new doctype doesn't have a '5' in it. It's not a HTML5 doctype, it's just a HTML doctype.

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 11:05 pm on Jan 1, 2014 (gmt 0)

drhowarddrfine,

However, we already know IE<9 doesn't know what the new elements are and won't let you style them

Can I style the tags inside the tags that IE<9 does not recognize and have the content appear the way that I have styled them? For example, if a have an <h2> tag and a couple of <p> tags inside a <section> tag (which IE<9, I believe, would not recognize), can I style the <h2> tag and the <p> tags and the content in those tags will appear the way that I styled them even though all of that would be in a <section> tag?

drhowarddrfine

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 4:23 am on Jan 2, 2014 (gmt 0)

Did you try it?

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4626921 posted 5:00 am on Jan 2, 2014 (gmt 0)

Can I style the tags inside the tags that IE<9 does not recognize and have the content appear the way that I have styled them? For example, if a have an <h2> tag and a couple of <p> tags inside a <section> tag (which IE<9, I believe, would not recognize), can I style the <h2> tag and the <p> tags and the content in those tags will appear the way that I styled them even though all of that would be in a <section> tag?

Yes or no, depending on exactly what you have in mind. It is not every day that you can put "MSIE" and "conforming user agent" into the same sentence. But even MSIE follows one basic rule: If you don't understand something, pretend you haven't seen it.

If you say something like
section h2 {color: blue;}
or
section {background-color: #EEE; padding: 1em;}
an elderly browser that doesn't know from <section> will not apply the styles, because it doesn't "see" the <section>.

Similarly
.blue {color: blue;}
will not make blue text in
<section class = "blue">
<p>blahblah</p>
</section>

BUT if you say
<section>
<h2 class = "blue">Blahblah</h2>
</section>

the header will be blue.

I have tested this in MSIE 5 with no dtd of any kind. That's FIVE in-- I have to assume-- "quirks" mode.

So if you want to use HTML 5 elements for semantic purposes, but you need to support older browsers, you'll need some supplementary <div>s or <span>s to carry the formatting.

JD_Toims

WebmasterWorld Senior Member Top Contributors Of The Month



 
Msg#: 4626921 posted 10:42 pm on Jan 3, 2014 (gmt 0)

For example, if a have an <h2> tag and a couple of <p> tags inside a <section> tag (which IE<9, I believe, would not recognize), can I style the <h2> tag and the <p> tags and the content in those tags will appear the way that I styled them even though all of that would be in a <section> tag?

Yes, you could even wrap your sections in a <div> or put a <div> within the <section> wrapping the content and style the <div> rather than the <section> for backward compatibility.

eg

<section>
<div class="section">
<p>stuff here</p>
</div>
</section>

<div class="section">
<section>
<p>stuff here</p>
</section>
</div>

drhowarddrfine

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4626921 posted 3:50 am on Jan 4, 2014 (gmt 0)

None of that is necessary if you use the javascript HTML5 shiv or shim created for IE.

This 69 message thread spans 3 pages: < < 69 ( 1 [2] 3 > >
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