Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member caterpixel's Avatar
    Join Date
    Dec 2006
    Location
    North Carolina
    Posts
    13
    Member #
    14487
    I'm working on a CSS stylesheet for a template that I want to make available for download, eventually. I'm creating 3 separate stylesheets to help make it easy for people to make changes:

    1. layout.css - just for structure, div widths, heights, reset styles, padding, margins, etc.

    2. typography.css - just for defining default font styles, faces, sizes

    3. colors.css - for colors only, making it easy to change the colors of the site.

    My question is, where is the best place to define padding for text? Since I'm using CSS reset, all default padding is set to 0. Thus, it bumps up to the very top of any div I have on my site. if those divs have a background image, it can be problematic.

    Do I put padding on the div elements in the layout.css file and leave padding values in my typography stylesheet at 0? Or do i set padding on the font elements themselves?

    For example, which is better practice:

    in typography.css:
    h1 { padding: 0; font-weight: bold; etc...}

    (in layout.css)
    div h1 {padding: 5px 0;}

    OR

    in typography.css:
    h1{padding: 5px 0; font-weight: bold; etc...}

    in layout.css:
    no paddings for text elements.

    Hope that makes sense...

  2.  

  3. #2
    Senior Member redefyned1's Avatar
    Join Date
    Oct 2009
    Location
    Dallas Texas
    Posts
    102
    Member #
    20249
    Liked
    5 times
    Typically you would just add the padding to the DIV itself.

    You mention that you are creating 3 stylesheets to make it easier for the user. I think this will actually make it more difficult since now they will have to access 3 different sheets in order to make modifications.

    Why not put it all in one CSS and divide up the three using comments?

    Just a suggestion.

    Ken


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:47 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com