CSS starter questions

Discussion in 'Programming' started by kkw16, May 14, 2012.

to remove all ads.
  1. kkw16

    kkw16 New Member

    Messages:
    1
    Hi I am a beginner coder in CSS.

    I am doing a reset for my style.css
    /* RESET */
    *{
    margin:0;
    padding:0;
    border:0;
    font-size:100%;
    vertical-align:baseline;
    text-decoration:none;
    display:block;
    }

    after using "display:block"

    my title tag shows up why is that?

    Should I not be using "*" to reset?

    Thank you

    kkw16
     
  2. ronaldroe

    ronaldroe Super Moderator Staff Member

    Messages:
    1,223
    You really shouldn't put display:block in your reset. It's likely why your title is showing up on your page. When you put that in there, everything that was set to display:inline, such as <span>, <em>, <b> and others will act as block level elements. They will have their own lines. Also, elements that are normally set to display:none, like the <title> tag, will now also be block level.

    Opinions vary on the use of the wildcard selector. Using that for your reset, for instance will cause list items to lose their bullets. Knowing that, I use it anyway and just add a margin back into list items.
     
    Last edited: May 14, 2012
  3. Edge

    Edge Member

    Messages:
    461
    As above using display: block on every element would be insane but wouldn't show your title element unless you have it in the wrong place. What's your HTML?
    For more info about resets read this: http://meyerweb.com/eric/thoughts/2011/01/03/reset-revisited/
     

Share This Page