homepage Welcome to WebmasterWorld Guest from 54.161.240.10
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Trouble with styling HTML5 tags
Genesis99




msg:4421820
 12:39 am on Feb 26, 2012 (gmt 0)

I am trying to add the html5 elements(aside,article,section etc. in in my mark up but I really do not want to style the elements. SO I tried adding them above and below the div I use for styling but I am having trouble using the margin:0px css that would usually put the div to the very top of the body element but because the html5 tage are there it does not work(really should have saw that coming).

I wonder if there is another way to not style the tags but make it work. Liek perhaps nesting the element inside the div like :
<div id="content">
<article>

*content*

</article>
</div>

would that work semantic wise?

 

lucy24




msg:4421832
 1:44 am on Feb 26, 2012 (gmt 0)

Don't know about anyone else, but I'm having a hard time figuring out what you mean by "style":
I really do not want to style the elements

and
the div I use for styling

and
another way to not style the tags but make it work

"Style" is about how something looks (presentation). It shouldn't have anything to do with how-- or whether-- an element works (semantics). Unless you goof and let an invisible element cover another element, such as an anchor, so the user can't "reach" the second element.

What are you trying to do-- or not do?

Genesis99




msg:4421837
 2:12 am on Feb 26, 2012 (gmt 0)

By style I mean applying any sorta css to it.
I want to use the section , article etc tags but I do not want to touch them with css.

lucy24




msg:4421870
 6:42 am on Feb 26, 2012 (gmt 0)

OK, narrowing down: Do you mean that you don't want to assign classes or IDs, like
<article class = "blahblah">
... or do you mean that you don't want to mention these elements in your CSS at all? Not even an all-purpose

article {look like this}
aside {look like this}

and so on?

At this point I can't be the only person asking: Why?

Oh, and what do you mean by "the div I use for styling"? This is another of those things that is probably completely obvious to you, but isn't obvious to the passing reader. (Like "it doesn't work", which can mean an amazing lot of different things!)

Next door in Apache there's some generic advice that applies equally well here: First figure out what you want to do, and describe it in plain English. Then work on getting the code to achieve what you want. If you skip the first part and proceed directly to the code, you are likely to end up in a big mess.

penders




msg:4421911
 11:01 am on Feb 26, 2012 (gmt 0)

It sounds like you are wanting to simply inject these HTML 5 elements as an afterthought, in order to make your document more semantic and hope that all your current styles will continue to work as is? This might not be the case, especially if you are creating an additional level of nesting in your elements.

I think in some cases these HTML 5 elements should ideally replace your generic DIV containers, as otherwise it's just adding unnecessary bloat to your page. Particularly if you are simply wrapping an HTML 5 element around one of your DIV containers.

Whether you have the <article> inside or outside the <div> shouldn't matter semantically IMHO?

...having trouble using the margin:0px css that would usually put the div to the very top of the body element...


This sounds like it might be a collapsing margins issue? With an additional element between your DIV and the BODY, the margins on the body are no longer collapsing...? Do you clear the padding/margins on the BODY element?

Genesis99




msg:4422161
 5:52 am on Feb 27, 2012 (gmt 0)

It sounds like you are wanting to simply inject these HTML 5 elements as an afterthought, in order to make your document more semantic and hope that all your current styles will continue to work as is?


Thats exactly what I want to do. Is it impossible?

penders




msg:4422178
 8:30 am on Feb 27, 2012 (gmt 0)

Well, it depends entirely on your current CSS, the structure of your document and your intended style-goal. ...and see my post above.

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