I suppose ASP could look like this: <% bcolor="#ff0000"; fcolor="#ffffff"; %> Gary [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Gary White [ip] => reply@newsgroup [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 10 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> 2 css questions - Macromedia Dreamweaver

2 css questions - Macromedia Dreamweaver

1) I have a .css file for a site I'm working on and it keeps growing and growing and its getting harder and harder to find things and stay organized. Other than seperating things out into 2 .css files, are there any strategies for organizing and keeping straight these big css files? 2) This question is counter-intuitive by its very nature, but humor me for a second... Can you use variables in a .css file. Here is why I'd want to: On my site I use (primarily) 3 different colors. These appear as td background colors, as text colors and ...

  1. #1

    Default 2 css questions

    1) I have a .css file for a site I'm working on and it keeps growing and
    growing and its getting harder and harder to find things and stay organized.
    Other than seperating things out into 2 .css files, are there any strategies
    for organizing and keeping straight these big css files?

    2) This question is counter-intuitive by its very nature, but humor me for a
    second... Can you use variables in a .css file. Here is why I'd want to: On
    my site I use (primarily) 3 different colors. These appear as td background
    colors, as text colors and link colors, as colors for H tags, etc... Lots of
    places! Wouldn't it be nice if at the top of my css file I could have :

    var color1: #FFFFFF
    var color2: #990000
    var color3: #CCCCCC

    Then later in my sheet I can just set things to "color1". This way if I want
    to change my color scheme, its EASY.

    Thanks
    --
    Alexander Ross
    [email]alexrossbleen.net[/email]


    Alexander Ross Guest

  2. #2

    Default Re: 2 css questions

    > are there any strategies
    > for organizing and keeping straight these big css files?
    1) Don't have DW write your CSS for you (that can get messy).

    2) Understand how CSS cascades. You probably have a lot of redundant classes
    and styles in your style sheet.
    > 2) This question is counter-intuitive by its very nature, but humor me for
    a
    > second... Can you use variables in a .css file.
    Yes...to an extent. I believe this is a CSS3 feature, which, I don't think,
    any browsers fully support, though I think Moz can handle a few things.
    Wouldn't it be nice if at the top of my css file I could have :
    > var color1: #FFFFFF
    > var color2: #990000
    > var color3: #CCCCCC
    >
    > Then later in my sheet I can just set things to "color1". This way if I
    want
    > to change my color scheme, its EASY.
    Oh...THAT kind of variable. Hmm...interesting idea, though, again, with the
    cascade, it's not that hard to spec those colors once and just change that
    one color.

    -Darrel


    darrel Guest

  3. #3

    Default Re: 2 css questions

    >... are there any strategies
    > for organizing and keeping straight these big css files?
    If you have (or can get) TopStyle, its "Style Sweeper" is great for
    neatening up style sheets. It automatically groups all the selectors by
    type, and then alphabetically, and formats the rules all nice and neat.
    Might be a start, at least! :-)
    > 2) This question is counter-intuitive by its very nature, but humor me for
    a
    > second... Can you use variables in a .css file.
    To the best of my knowledge, you can't use variables in an *external* style
    sheet, but you can definitely use them in a doent style sheet
    (<style></style>) within an HTML (or XHTML) page.

    Hope that might help.

    --
    Ptty Ayers
    [url]http://www.WebDevBiz.com[/url]
    Professional Web Business Tools:
    Web Design Contract, Estimate Worksheet, and more
    --


    P@tty *TWB* Guest

  4. #4

    Default Re: Re:2 css questions

    Where is a CSS Style switcher extension?
    I don't think I have that one,,,,hmmm,,,

    --
    markinoregon
    Website under construction as allways!
    [url]www.markthesteelhead.com[/url]
    "Capt. Verde" <stevecapt-verde.net> wrote in message
    news:bg3gl6$bc3$1forums.macromedia.com...
    > Why not create a CSS sheet for each color scheme and if and when you want
    to change it just call out for the different color scheme CSS sheet, you can
    even use a extension to allow users to switch which CSS sheet they want to
    load to give a appearance they like.
    >
    > Always remember, no matter where ya go....there ya are!

    markinoregon Guest

  5. #5

    Default Re: 2 css questions

    Ptty *TWB* wrote:
    >> ... are there any strategies
    >> for organizing and keeping straight these big css files?
    >
    > If you have (or can get) TopStyle, its "Style Sweeper" is great for
    > neatening up style sheets. It automatically groups all the selectors
    > by type, and then alphabetically, and formats the rules all nice and
    > neat. Might be a start, at least! :-)
    I agree. TopStyle is excellent for keeping things in order. You can also get
    10% off by following the link in my sig.

    The best strategy for keeping CSS files manageable, though, is to build
    stylesheets that make full use of the cascade. I've seen dozens of
    stylesheets where the font-family and size is conscientiously repeated for
    just about every element on a page. Setting the defaults in the body style
    eliminates the need to do that. Then all you need to do is create styles for
    elements you want to override the default. The same for colours. Also make
    full use of the shorthand properties, such as border, rather than
    border-right, border-left, border-top, border-bottom.

    Learning how to use the cascade efficiently takes time (I used to write
    repetitive rules myself, and I'm sure many are left in my sites), but it
    makes things a lot easier in the end.

    --
    David Powers
    *******************************************
    No-nonsense reviews of computer books
    [url]http://japan-interface.co.uk/webdesign/books.html[/url]
    Save 10% on TopStyle CSS Editor
    *******************************************


    David Powers Guest

  6. #6

    Default Re: Re:2 css questions

    Kaosweaver has a great one too...it lets you put some links on a page and associate each one with a certain CSS style sheet that when clicked loads that particular style sheet and change the appearance.

    Always remember, no matter where ya go....there ya are!
    Capt. Verde Guest

  7. #7

    Default Re: 2 css questions

    In article <bg3fli$98e$1forums.macromedia.com>,
    "Ptty *TWB*" <payersNOSPAMnc.rr.com> wrote:
    > > 2) This question is counter-intuitive by its very nature, but humor me for
    > > a second... Can you use variables in a .css file.
    >
    > To the best of my knowledge, you can't use variables in an *external* style
    > sheet, but you can definitely use them in a doent style sheet
    > (<style></style>) within an HTML (or XHTML) page.
    How so?

    --
    Eric A. Meyer
    [url]http://www.meyerweb.com/eric/[/url]
    Eric A. Meyer Guest

  8. #8

    Default Re: 2 css questions

    I don't usually bottom-post, but I did this time. Please see below:

    "Alexander Ross" <alexrossbleen.net> wrote in message
    news:bg3dc7$4he$1forums.macromedia.com...
    > 2) This question is counter-intuitive by its very nature, but humor me for
    a
    > second... Can you use variables in a .css file. Here is why I'd want to:
    On
    > my site I use (primarily) 3 different colors. These appear as td
    background
    > colors, as text colors and link colors, as colors for H tags, etc... Lots
    of
    > places! Wouldn't it be nice if at the top of my css file I could have :
    >
    > var color1: #FFFFFF
    > var color2: #990000
    > var color3: #CCCCCC
    >
    > Then later in my sheet I can just set things to "color1". This way if I
    want
    > to change my color scheme, its EASY.
    This is very possible, at least the way I did it. I'm using ASP. At the top
    of all my ASP pages, I have an include which calls a little page called
    colors.asp. It contains stuff like:
    textcolor1="#123456"
    bgcolor1="#000000"

    Then, in the external css, I have

    ..maintitle {
    color: <%=textcolor1%>
    background-color: <%=bgcolor1%>
    }

    It's been a big help, and when the boss told me to change the color scheme
    of the whole web-based app I am writing,, it was very easy to do, easier
    than just using CSS.

    It's by far the most helpful, creative thing I have ever come up with by
    myself.


    middletree Guest

  9. #9

    Default Re: 2 css questions

    "Alexander Ross" <alexrossbleen.net> wrote in message
    news:bg3dc7$4he$1forums.macromedia.com...
    > . Can you use variables in a .css file. Here is why I'd want to: On
    > my site I use (primarily) 3 different colors. These appear as td
    background
    > colors, as text colors and link colors, as colors for H tags, etc... Lots
    of
    > places! Wouldn't it be nice if at the top of my css file I could have :
    >
    > var color1: #FFFFFF
    > var color2: #990000
    > var color3: #CCCCCC
    Yes, it is possible. At least with Coldfusion (don't know about ASP, PHP,
    etc).

    I explain the method on another post in this thread.


    --
    irvin
    ----------------------------------------
    [url]http://www.pixel69.com[/url]



    irvin Guest

  10. #10

    Default Re: 2 css questions

    On Mon, 28 Jul 2003 17:14:42 -0400, "Ptty *TWB*"
    <payersNOSPAMnc.rr.com> wrote:
    >At least with CF, by putting the variables right into the style rule.. I'm
    >trying to find the CF book where I saw it done, but it seemed pretty
    >straightforward. Is there something about that that you know to not be
    >do-able?
    You can do it with any server side scripting language. I don't know
    anything about CF, but in PHP, it might look like this:

    <?php
    $bcolor="#ff0000";
    $fcolor="#ffffff";
    ?>

    <style type="text/css">
    <!--
    body {
    background-color: <?=$bcolor?>;
    color: <?=$fcolor?>;
    -->
    </style>

    I suppose ASP could look like this:

    <%
    bcolor="#ff0000";
    fcolor="#ffffff";
    %>

    <style type="text/css">
    <!--
    body {
    background-color: <%=bcolor%>;
    color: <%=fcolor%>;
    -->
    </style>


    Gary
    Gary White Guest

  11. #11

    Default Re: 2 css questions

    It can be done with any server technology. Eric was probably thinking about
    it being done client-side in the css.

    --
    Al
    > At least with CF, by putting the variables right into the style rule.. I'm
    > trying to find the CF book where I saw it done, but it seemed pretty
    > straightforward. Is there something about that that you know to not be
    > do-able?
    >
    > --
    > Ptty Ayers
    > [url]http://www.WebDevBiz.com[/url]
    > Professional Web Business Tools:
    > Web Design Contract, Estimate Worksheet, and more
    > --
    >
    >

    Al Sparber- PVII Guest

Similar Threads

  1. Two questions, for those who may know
    By RichA in forum Photography
    Replies: 4
    Last Post: December 9th, 04:57 AM
  2. 2 questions.
    By usegobos webforumsuser@macromedia.com in forum Macromedia Fireworks
    Replies: 1
    Last Post: October 5th, 07:30 PM
  3. a few questions
    By Jaxx in forum Macromedia Director Lingo
    Replies: 4
    Last Post: October 3rd, 12:12 PM
  4. IIS Log Questions.
    By Shawn & Jo-an Mehaffie in forum ASP.NET General
    Replies: 0
    Last Post: August 5th, 04:13 AM
  5. 2 questions :) - portal questions
    By John Weinshel in forum FileMaker
    Replies: 3
    Last Post: July 14th, 04:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •