Jump to content

Two CSS styles


Agustine

Recommended Posts

I'm doing an update to my website with the CS ebcause it became to much to keep track of in one huge CSS file. I decided to move the css from this one file into seperate files to have better orginization.Is it possible to have two css styles in one page like so:

<link rel="stylesheet" type="text/css"href="CSS\general.css" /><link rel="stylesheet" type="text/css"href="CSS\index.css" />

I'm asking because when I load the page, all the css from the index.css works. However, the background style doesn't work from the general.css doesn't work while everything else does. Now I did copy the background style from the previous CSS file, and pasted it into the new general.css. It works from the old CSS style but not in the general.css. I then deleted that piece an remade it from the background CSS tutorial, and that didn't work either.Here are the files:general.css

body /*Background image settings*/{background-image:url('Images/back2.gif');background-repeat: no-repeat}p/*The Text Settigns*/{	color: black;	font-size: 100%;	font-family: Arial;	z-index: 2;}img/*Setting all Borders of Images to '0'*/{	border: 0;}img.welcome/*Title Header of each Page*/{	position:absolute;	top:85px;	left:245px;	z-index: 0}img.buttonback/*Backdrop of the buttons*/{	position:absolute;	top:150px;	left:0px;	z-index: 1}p.button/*Button Alignments*/{	position:absolute;	top:158px;	left:10px;	z-index: 2}/*The different footer set ups*/img.footer/*Footer Picture*/{	position:absolute;	top:1100px;	left:250px;	z-index: 1;}img.footer5/*Footer Picture*/{	position:absolute;	top:1300px;	left:250px;	z-index: 1;}p.footer6/*Footer Text*/{	position:absolute;	top:1375px;	left:250px;	z-index: 1;}p.footer2/*Footer Text*/{		position:absolute;	top:1175px;	left:255px;	font-family: arial;	color: gray;	font-size: 65%;	z-index: 2	}img.sale/*Promotion Image*/{	position:absolute;	top:379px;	left:0px;	z-index: 1}

index.css

img.varilux{	position:absolute;	top:230px;	left:135px;}p.bot/*Bottom Text of the Home Page. It is Static*/{	position:absolute;	top:825px;	left:100px;}p.descrip/*Brief description of Peepers*/{	position:absolute;	top:575px;	left:205px		}img.sidebar/*Sidebar image, changes*/{	position:absolute;	top:100px;	left:575px;	z-index: 1;}img.frameshow/*Shows off a frame, changes*/{	position:absolute;	top:600px;	left:245px;	z-index: 1}p.news/*News or articles. This is static*/{	position:absolute;	top:225px;	left:200px;	z-index: 2}

Thanks.

Link to comment
Share on other sites

The priority of stylesheets is based on the order they are being ilnked. A later imported stylesheet has higher priority. So, scince general.css was called before index.css, all styles in general.css have lower priority then index.css. In other words, every style in index.css will be used, even if general.css specifies something else for that style.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...