1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

overriding external CSS with inline

Discussion in 'CSS' started by dpr, Apr 8, 2007.

  1. #1
    Hi, I'm a stupid n00b to CSS, hope someone can help me with this.

    I am making a website that links to an external CSS file which is just a two-column web template. I have five pages for the site, but on one of the pages, I only want one column. So I deleted the HTML code to get rid of column two, but the text in column one doesn't travel across the whole screen, because the width for column one is set to 500px in the external CSS (colOne.. width=500px... etc)

    I'm thinking I can override this using inline CSS within the HTML of the specific page, beside the "div id equals col1" tag and just change the width to 800px or something, but I don't know how.

    I'm sure it's just one line of code but I can't find out how to do it! help please! :scared:

    mike
     
    dpr, Apr 8, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    You already posted this question on another forum and received an answer. Why are you wasting people's time asking for duplicate help?

    gary
     
    kk5st, Apr 8, 2007 IP
  3. dpr

    dpr Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    uhhh hi? The reason i am re-posting this on this forum is because i have not received an answer yet. What other forum are you talking about? I've subscribed to all my threads so if I've received an answer then I haven't been notified. I'd like to know what forum you're talking about. And why don't you just answer my question? If you don't know the answer, then don't respond to the thread.
     
    dpr, Apr 9, 2007 IP
  4. dmi

    dmi Well-Known Member

    Messages:
    2,705
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Type <div style="width: 800px">CONTENT</div>
     
    dmi, Apr 9, 2007 IP
  5. dpr

    dpr Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey, it worked! Thanks, man!

     
    dpr, Apr 9, 2007 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    Did you happen to notice the green colored text in my post? That's a link. If you click on it, it will take you to the other forum and to your thread in that forum. By noon, Sunday, 7½ hours before your post here, there were two answers. Each of them gave you a perfectly valid method to use.

    It was pointed out that inline styles are the worst way to do things. Using inline styles negates all the advantages of separation of structure and presentation. They should be avoided.

    gary
     
    kk5st, Apr 9, 2007 IP
  7. dpr

    dpr Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Oh okay, i'm sorry, my mistake, i didn't see the link. That forum admin never emailed me, and I guess I forgot I posted there. The code that "dmi" just gave me works, but you're saying it's a bad idea? I'll try some of the ideas from the guys at CSS Creator, thanks



     
    dpr, Apr 10, 2007 IP
  8. briansol

    briansol Well-Known Member

    Messages:
    221
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #8
    ANYTHING inline is a bad idea, as it makes maintence later harder to track down, and adds weight to the page for no good reason.

    Simple, make a NEW div id name for the single col...

    like, instead of <div id="main"> try <div id="wide"> or something like that, and then add the css code for #wide { width: 800px; } or whatever your values may be.
     
    briansol, Apr 10, 2007 IP
  9. thechasboi

    thechasboi Guest

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    But having inline css is good for overriding the class. One other thing you might want to do is to name that div give it a unique ID. Inside the css file after the class that is already attached to that div you insert this #dividhere{width:800px;} That should work in alleviate width problem and possibly other thing such as color or background. Hope this helps.
     
    thechasboi, Apr 12, 2007 IP