Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS background cuts short of text

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #194938
    bikejunkie
    Participant

    http://codepen.io/anon/pen/XJedqg

    Hello folks;
    If you have any advice I appreciate it.
    I’ve been working on a long scrolling site and the background cuts short about halfway through. The whole is enclosed in a container div.
    <mystified>

    #194939
    shaneisme
    Participant

    .textblock shouldn’t have float: left, or you should clear them properly… but I don’t see why they need a float to begin with. An element that is floated is taken out of the flow of its parent and won’t take up space within it.

    #194940
    shaneisme
    Participant

    Question though – for this bit:

    * {
      margin: 0;
      padding: 0;
      width: 100;
    }
    

    Do you know what that does?

    #194942
    bikejunkie
    Participant

    thanks so much Shane. That solved a big puzzle.
    the margin:0/padding:0 is a reset.
    If we want to control the look fully (lets say keep the navbar all the way at the top, then the reset allows full control. Otherwise the browser uses it’s own default margins.
    Some reset.css files also have lineheight:1em and more

    #194943
    shaneisme
    Participant

    I was playing a bit coy, I know very well what a reset does.

    The * property means you’re going to give everything zero margin and padding. A bit overkill.

    But width: 100 is an invalid property as it does not have a unit, eg. %, px, em, etc.

    I would look to Normalize. It only fixes the things that need to be fixed without overdoing things (and shaves off a few CPU cycles to your website). Plus, you can learn a lot about CSS that way.

    https://github.com/necolas/normalize.css/blob/master/normalize.css

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.