Forums

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

Home Forums CSS Single CSS File and Multiple Pages

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #236817
    BCDILLON7613
    Participant

    Hi guys! This is my first doing a multi-page website with css external style sheet and I need some help. My question how or what are the steps to design the rest of my website by using only one css file. My first thought to create multiple ones and each page with have their own, but I am pretty sure there are ways around this. Please help, thanks in advance!

    #236818
    Shikkediel
    Participant

    Unless the pages are exactly the same, I can’t see how that would be very efficient. If there are common factors on the other hand, you could do with two – a main version (that could be cached) and an individual one.

    #236819
    BCDILLON7613
    Participant

    Okay cool, I was wondering because I am also still in school doing this and my professor said it was bad practice because if i change it I would change the entire site. My home page has a jumbotron but the rest of the site will not. They will just have information about the organization.

    #236870
    Beverleyh
    Participant

    my professor said it was bad practice because if i change it I would change the entire site

    That’s the beauty of a common CSS (or JS) file – consistent styling around your site can be changed easily from one place.

    Unless individual pages contain reams of custom CSS, you’re fine to put it all in the one file. It’s text-based – it minifies and compresses well, so a few extra bytes on the overall size of the CSS file trumps an extra HTTP request for a secondary stylesheet.

    Everyone has their own preferences but you could define common styles right at the top of your CSS file and then add small blocks of custom CSS for any pages that need something more below.

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