Forums

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

Home Forums CSS How to override body styles in same CSS?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44909
    stephhowl
    Member

    I am working in Joomla 1.5 (unfortunately). It’s Struggle City over here. I am trying to create some landing pages unique from the rest of the site. I have no idea how to call a new stylesheet and cancel out the other one, so to do this, I need to write the new CSS in the global.css (where the rest of the CSS for the sit is) so that it overrides the other CSS, but just on the pages I assign. Here is what I’ve tried but it’s not working:

    .page466 #body { width:864px; margin:0px 20px 20px 80px; background-color: #007FFF; }

    Any ideas would be much appreciated.

    #135773
    Alen
    Participant

    Is there a way for you to create a template for this type of page?
    Is there a way for you to add ID’s or Classes to the HTML?

    > .page466 #body { width:864px; margin:0px 20px 20px 80px; background-color: #007FFF; }

    This doesn’t give us much info. Do you have a live example? Or you can code one here: http://codepen.io/pen/

    #135775
    Anonymous
    Inactive

    I know you can override CSS styles using Jquery and you can have the color and just about anything change with onclick or when the page loads. Heres an example of what i mean. http://codepen.io/Jarolin/pen/DsklI

    #135777
    CrocoDillon
    Participant

    Do you actually have an element with id body or is it a typo?

    `.page466 #body` targets element with id body

    `.page466 body` targets body element

    …assuming you have class page466 on the html element.

    #135779
    stephhowl
    Member

    I’m a big dummy and I had the wrong page #. Thanks guys!

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