Solved

Over-riding style sheet settings

Posted on 2006-11-22
4
167 Views
Last Modified: 2010-04-09
I have a page linked to a style sheet but I wish, in one area defined by a div id, to change the background image. Can I do this and if so what is the code?
0
Comment
Question by:MkeNixon
4 Comments
 
LVL 21

Expert Comment

by:shuboarder
ID: 17997358
Perhaps you can override one CSS with another?
http://www.flexwiki.com/default.aspx/FlexWiki/StylesheetOverride.html
0
 
LVL 30

Expert Comment

by:Steggs
ID: 17997372
You can override the stylesheet with code in the <head></head> or inline style

Regards
0
 
LVL 12

Accepted Solution

by:
jessegivy earned 125 total points
ID: 17997509
Nice link shuboarder provided :)  ...explains objective quite well!  I believe that inline styles are frowned upon slightly because it's not as clean as including in your main CSS and you'd have to edit the tag if you wanted to change it, but for single tag modifications can be a quite useful shortcut.

If you are interested in inline styles it's done like this:

<div style="background-image:url('images/otherBackgroundName.jpg');"></div>

Cheers,

Jesse
0
 
LVL 11

Expert Comment

by:ethoths
ID: 18007708
A cleaner way would be in your style sheet...

#id
{
   background-image:url('BackGroundName.jpg');
}

Where id is the id of your div.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flexbox in CSS3 2 39
Bootstrap 3 with accordion menu 2 45
Issue in webpage 6 34
Javascript create file issue 4 47
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now