Results 1 to 3 of 3

Thread: manual css override, when external css exists

  1. #1
    Join Date
    Sep 2008
    Location
    Bastrop Texas
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    manual css override, when external css exists

    I have an external css file
    with...
    Code:
    #bg {
    	margin:0 auto;
    	padding:0;
    	background:transparent ;
    	background-image: url( bg.jpg ) ;
     	background-repeat:no-repeat;	
    	background-position: center top ;
    }
    in my html i use
    Code:
    <div id="bg">
    it works fine, but I want to manually override the background image without changing the external css

  2. #2
    Join Date
    Dec 2009
    Beans
    174
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: manual css override, when external css exists

    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="default.css">
    <style type="text/css">
    #bg {
    margin:0 auto;
    padding:0;
    background:transparent ;
    background-image: url( bg.jpg ) ;
    background-repeat:no-repeat;
    background-position: center top ;
    }

    </style>
    </head>

    Place it IN your html file.

    This is called internal css.

    There is another method called inline css.

    <div style="background-image:url(bg.jpg);">


    External
    Internal (This overrides external)
    Inline (This overrides the above 2)





    </html>

  3. #3
    Join Date
    Sep 2008
    Location
    Bastrop Texas
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: manual css override, when external css exists

    thank you, inline is what i was looking for. this worked for only overriding the background-image

    Code:
            <div id="bg" style="background-image:url(bg.jpg);">

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
  •