SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jul 2004
    Location
    Jed.
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Override padding

    Hello,

    How can I override a

    Code:
    padding-left:0;
    I don't want the
    Code:
    padding-left:0;
    I want
    Code:
    padding-right:0;
    I don't want to alter the original css. I want to override it. Basically, I want to cancel the effect of
    Code:
    padding-left:0;

  2. #2
    SitePoint Enthusiast archanapatel's Avatar
    Join Date
    Aug 2008
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can give it directly to element in style tag.

    Ex.
    <div style='padding-left:0;'></div>

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Although that pretty much erases the whole point of using CSS in the first place... might as well stick ALL your styles in the HTML then. So you have to now change that inline padding style on every single one of your company's 300 HTML pages? In all the places it was added?

    : )

    BTW padding-right has nothing to do with padding left. If there's currently no padding on the right anyway, then there's nothing to override.

    If you want padding on the left and remove whatever padding IS on the right, then:
    element {
    padding-left: add what you wanted;
    padding-right: 0;
    }

    The answer completely depends on what you already have in your CSS and what the corresponding HTML is.

    It's like saying you want to override your right shoe being red, by making the left shoe blue. Making the left show blue doesn't change the right shoe either way. The two are not mutually exclusive or anything.


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
  •