Grow your CSS skills. Land your dream job.

twentytwelve theme css mess

  • # March 12, 2013 at 2:11 am

    [Your text to link here...](http://www.proto.annethullfineartdesigns.com/anne-thull-fine-art-designs/ “http://www.proto.annethullfineartdesigns.com/anne-thull-fine-art-designs/”)

    This header is what it needs to look like but I know it’s not proper. I can’t select the H2 tagline text and it’s all over the place on the iPhone. Should I avoid absolute positioning? Should I put new divs above the hgroup or inside?

    # March 12, 2013 at 6:32 am

    >Should I avoid absolute positioning?

    Like the plague.

    # March 12, 2013 at 8:13 am

    To expand further.

    Generally, we read left to right and from top to bottom (excepting, of course, those that don’t) but that generality is fundamental to, say, websites in English.

    As such, we should try to structure our HTML in the same way. If your logo/hgroup is top-left it should come before anything else in your HTML…and so on.

    That way there is little need to move things about with absolute &/or relative positioning.

    # March 12, 2013 at 10:28 am

    Hey jk,
    I noticed a couple of things that are causing your issue

    1. You are using clear:both; on the search form and on all h1 tags.
    2. But then you are overwriting the clear:both using positioning attributes
    3. This will be a never ending battle when building a responsive site and a lot of unnecessary CSS

    I would recommend that you

    1. Remove position attributes from all elements in your header
    2. Look at using clear:right on search from instead of clear:both
    3. Remove the clear:both from h1 and h2 tags
    4. Re-position elements using margin and padding

    * Side note I would look at removing the clear:both from your h1, h2,h3, h4, h5, h6 elements and create a class that you call only when you need to use the clear:both attribute.

    If this does not work for you try putting the code in Codepen an leaving us a link here.

    # March 12, 2013 at 12:33 pm

    For your side note, can you give me an example?

    As for the height I need on the header, should I set a height to something like hgroup, #branding, or #header? Or just use the margins on the elements to push the height?

    Also, if you inspect the main navigation something doesn’t seem right. Any suggestions?

    Thanks for this effective advice.

    # March 12, 2013 at 12:48 pm

    To be honest, I would consider re-structuring the whole header; putting things in the right order and using padding/margins to settle things in place rather than ANY positioning.

    That’s not to say that positioning doesn’t have it’s place but overuse can lead to problems later.

    I’m also confused why your logo h1 is ALL an image but your h2 isn’t. Wouldn’t it make sense to just use one image &/or actual text in the h1/h2 with the appropriate font-family. Granted the AT logo probably needs to be an image…but the rest of it…nah.

    As for the navigation, I’m unsure why the background image has been applied to the ‘body’ instead of just the navigation ‘ul’.

    # March 12, 2013 at 1:13 pm

    Yeah we’re on the same page with restructuring.

    As for the H1 logo. Appropriate font styling is easier said than done when it comes to the designer. So I used the logo as the h1 site title and text as the h2 tagline. Just don’t know how else to do it.

    For the nav. Please enlighten me on how to get the ul background to go full width.

    Thank you, I’m learning a lot.

    # March 12, 2013 at 1:17 pm

    >Appropriate font styling is easier said than done when it comes to the designer.

    Does that mean you don’t have access to the font used for the h1 text (excluding the AT ‘logo’)?

    # March 12, 2013 at 1:23 pm

    For the nav bg image, I’m not sure how much flexibility there is in the 2012 theme. Does everything have to be inside a single wrapper with the ‘site’ class?

    # March 12, 2013 at 1:42 pm

    Not sure what to do because I did find a web font but it needs to have a specific kerning and such. I did find this [Your text to link here...](http://www.myfonts.com/fonts/urw/columna/ “http://www.myfonts.com/fonts/urw/columna/”)

    # March 12, 2013 at 2:00 pm

    Maybe I should get the source straight first. The new elements I introduced are the header-menu, phone, and search_form. Where should I place these in the code?

    # March 12, 2013 at 2:04 pm

    [Your text to link here...](http://codepen.io/JKNetDesign/pen/DCaJr “http://codepen.io/JKNetDesign/pen/DCaJr”)

    # March 12, 2013 at 2:58 pm

    You can’t put PHP in Codepen.

    You have to give us the HTML output

    # March 12, 2013 at 3:02 pm

    I updated it.

    # March 12, 2013 at 6:55 pm

    jk take a look at [http://codepen.io/doublea79/pen/ItJFj](http://codepen.io/doublea79/pen/ItJFj “Code PEN link”)

    I commented on some of your HTML and made some suggestions

Viewing 15 posts - 1 through 15 (of 42 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".