AndrewRyan
02-24-2011, 09:45 PM
Hey guys, I'm new here and just getting into web design.
While I can't do any javascript myself yet, I found a neat bit of script that lets you change alternate stylesheets within a page and remember the selected stylesheet with a cookie. This has let me make different themes and layouts without actually owning the server I'm uploading to (I'm taking a first year course so I upload to one of my uni's servers).
So I have a global.css (stylesheet) and styleA.css, styleB.css, etc (alternate stylesheets).
Anyways it's worked like a charm so far, but I've been having some problems changing images using this. Basically the problem is I of course can't specify different html information with just a change in CS. I can choose how to display it, or if I want to display it, but I can't find a way to point it in another direction. Or more concisely there doesn't seem to be a way to specify the source of image tags within my css files.
The only way to specify the source of an image in css I have found so far is to use the background-image property. That worked for example on my banner (I know it should be consistent regardless of style but I'm playing with ideas here) but doesn't seem to work on images side by side.
This is an issue because my navigation links are images that only go with one theme (I have a set for each theme). The simple solution would be to just use background colors for my buttons, but I like how they've turned out. The less simple solution would be to have 4 navigation bars in each page and have the alternate stylesheet have display:none on all but one of them. That is very wasteful though.
In the end I gave each nav button an id and am now trying to configure them so they will show whatever background images the alternate stylesheet specifies should be applied to each id. THIS IS NOT WORKING.
I have tried everything: unordered lists, divs in divs, paragraphs in divs, tables with each td corresponding to a button, etc. Nothing works and it is getting frustrating.
Firefox seems to be ignoring any height and width I specify for the elements containing background images unless writing exists within it. I think this is occurring with inline elements. However I can't set them to display:block because the nav bar is horizontal. I haven't found anyway to get these background images to display at their proper size next to each other, centered on the page without using img tags in the HTML.
Basically I need either
a) a way to specify the actual img tag source from a css file
b) an alternative way to specify any kind of image source to an element (other than background-image)
or
c) an HTML format in which I can get multiple background images to display at their correct sizes and next to each other and link to other pages (I've tried a lot on this one). Preferably using a list or, if I can avoid it, at least not using a table.
Sorry for being horrendously long-winded, I'm rather a poor summarizer. Thanks to anyone who takes the time to try and help.
---
A man chooses, a slave obeys.
While I can't do any javascript myself yet, I found a neat bit of script that lets you change alternate stylesheets within a page and remember the selected stylesheet with a cookie. This has let me make different themes and layouts without actually owning the server I'm uploading to (I'm taking a first year course so I upload to one of my uni's servers).
So I have a global.css (stylesheet) and styleA.css, styleB.css, etc (alternate stylesheets).
Anyways it's worked like a charm so far, but I've been having some problems changing images using this. Basically the problem is I of course can't specify different html information with just a change in CS. I can choose how to display it, or if I want to display it, but I can't find a way to point it in another direction. Or more concisely there doesn't seem to be a way to specify the source of image tags within my css files.
The only way to specify the source of an image in css I have found so far is to use the background-image property. That worked for example on my banner (I know it should be consistent regardless of style but I'm playing with ideas here) but doesn't seem to work on images side by side.
This is an issue because my navigation links are images that only go with one theme (I have a set for each theme). The simple solution would be to just use background colors for my buttons, but I like how they've turned out. The less simple solution would be to have 4 navigation bars in each page and have the alternate stylesheet have display:none on all but one of them. That is very wasteful though.
In the end I gave each nav button an id and am now trying to configure them so they will show whatever background images the alternate stylesheet specifies should be applied to each id. THIS IS NOT WORKING.
I have tried everything: unordered lists, divs in divs, paragraphs in divs, tables with each td corresponding to a button, etc. Nothing works and it is getting frustrating.
Firefox seems to be ignoring any height and width I specify for the elements containing background images unless writing exists within it. I think this is occurring with inline elements. However I can't set them to display:block because the nav bar is horizontal. I haven't found anyway to get these background images to display at their proper size next to each other, centered on the page without using img tags in the HTML.
Basically I need either
a) a way to specify the actual img tag source from a css file
b) an alternative way to specify any kind of image source to an element (other than background-image)
or
c) an HTML format in which I can get multiple background images to display at their correct sizes and next to each other and link to other pages (I've tried a lot on this one). Preferably using a list or, if I can avoid it, at least not using a table.
Sorry for being horrendously long-winded, I'm rather a poor summarizer. Thanks to anyone who takes the time to try and help.
---
A man chooses, a slave obeys.