Forums

Give help. Get help.

  • # October 2, 2008 at 2:49 pm

    Gosh this is going to be such a newby question. I am REALLY catching on to CSS and HTML, so far I have studied alot but what I have no experience doing is making multiple pages.
    My question is.. do you make a new CSS document for each page of your website? or do you put ALL the coding for every page in one document. Also, is it best to embed the CSS file to the HTML file or external? So far I have been doing external.

    I tried studying some sites and when I look at their CSS for each page within the site it looks like there is some different code or order in each. So Im wondering do you make your home page, take that CSS file, rename it then use it and tweak it for say.. your about me page, and save it with a new name linked to that page.

    Hope Im not confusing, any tips on this subject would be great.. or links to info on the subject.

    med
    # October 2, 2008 at 3:23 pm

    1 is usually enough for most sites. Those that are larger may have multiple css files to help de-clutter everything. You can usually keep all of your css code in that one file and just pull it from within html. Again to keep everything organised it’s best to have an external css file. Though if your css consists of only a few lines then it’s easier to put it in the header.

    Yeah you can tweak it. For example if you want particular styling for text on one page and different on another then you would tweak that section of the css and upload with a different file name and link to that instead. Otherwise that one css file would influence two different pages when you don’t want it to.

    vee
    # October 3, 2008 at 10:32 am

    You can mark the different styles for each page by a small comment: /*…..*/

    If you got different styles on the pages (eg. different backgrounds) you can give id’s on the body tag:

    <body id="startpage">…</body>

    stylesheet:

    #startpage
    {
    …styles}

    vee
    # October 3, 2008 at 1:52 pm

    I work with Aptana, cos at first it’s open-source and second fact is that it’s easy to browse the CSS files: there’s a search window where u can type in the name of the id or class and it’ll find it for u. In addition it shows u a list of all id’s and classes, so u can easy navigate to them..

    vee
    # October 3, 2008 at 1:54 pm

    That’s cool I’m not the only woman…here in Germany it’s pretty rare that there are women who work on sth like that..

    # October 3, 2008 at 2:00 pm

    Personally, I love using SASS (http://haml.hamptoncatlin.com/docs/rdoc … /Sass.html) While it’s a little tougher to use outside of the Rails framework, it makes a cinch of writing CSS. Furthermore HAML is a true gem (no pun intended) when it comes to writing markup. You can be the judge. What looks prettier, this

    Code:


    My Site

    My Site

    Lorem ipsum yadda yadda


    or this?

    Code:
    %html
    %head
    %title My Site
    %body
    #page
    %h1 My Site
    %p Lorem ipsum yadda yadda

    More on topic, SASS handles the "encapsulation" you usually have to do manually in a CSS file. So instead of writing

    Code:
    div#page {
    width: 800px
    }
    div#page p {
    padding: 10px
    }
    div#page p a {
    color: red
    }

    you can write

    Code:
    div#page
    :width 800px
    p
    :padding 10px
    a
    :color red
    # October 3, 2008 at 3:09 pm

    The only issue with having TONS of information inside a CSS file is a speed issue for people with 56k modems and all that. Personally, I’m really not concerned if my CSS file is bigger than 8kb (suggested size to give 56k connections a good experience), because it’s really high-time they get better connections (sorry to all those people who can’t help it, and damn those who can :P).

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag