SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Preventing inheritance on specific HTML tags!?

    Hi,

    I give out HTML code to other website owners and they put the code into their own page.

    The HTML code i give them uses inline CSS, for example:

    <a href="http://www.example.com/" style="font-family: arial;">

    The PROBLEM is that the HTML code with the inline styles that i give them inherits the styles in the stylesheet already on that person's site.

    So, for example, if that person puts 5px of left padding on every link, my link inherits 5px of left padding to.... grrrrrrr.

    Unless i specify padding-left: 0;

    So i basically have to counter every known style in existence to stop my html code from inheriting THERE style sheet's styles

    Is there a CSS property which i can add to my inline CSS, which tells a web browser NOT to inherit any other CSS rules?

    So i just basically want some sort of property which says to the web browser "do not apply any CSS styles to this HTML tag besides the ones which are specified in the inline style already.

    ....if it's possible?

    Do you have any solutions? Please help...

  2. #2
    SitePoint Addict CaryD's Avatar
    Join Date
    Nov 2006
    Location
    San Diego, CA
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by iluvboobies View Post
    Is there a CSS property which i can add to my inline CSS, which tells a web browser NOT to inherit any other CSS rules?
    No.

  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks. im screwed then

  4. #4
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well there's two ways you can handle this.

    One is to relinquish some control over the visual appearance of your syndicated content - just allow it to inherit styling and leave it up to site owners to make sure it looks good.

    Or you could put your content in an iframe, and just get site owners to include that, pointing to a page on your site. That's what most ad providors do.


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
  •