Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
Acmlm's Board - I3 Archive - Programming - Images in CSS? | New poll | | |
Add to favorites | Next newer thread | Next older thread |
User | Post | ||
Deleted User Banned Since: 05-08-06 Last post: None Last view: 6432 days |
| ||
I was wondering how you would code an image in CSS so that if you put <div style=banner></div> (Or somthing along that lines.) it would show the picture supplied in the CSS file. I know this is possible since I used to use it in my layout (I don't recall why.. >_> ) but I was thinking something like this would work:
.banner { content: url('schemes/night/banner.png'); width: 468; height: 60; } (With: <div style=banner></div> I was wrong. The reason I want to do this is because I have broken my board up into seperate areas (Not AB so don't say: OMG LEIK THIS SHOULD BE IN AB PROGRRAMMNIG!) and for each area it loads a different CSS file therefore making it possible to make the banner change through CSS. This can easily be done in MySQL but I would prefer it in CSS just because it would be easier in my view. |
|||
Sukasa Birdo Not quite as active as before. Xkeeper supporter Xk > ||bass I IP Banned myself! Twice! Since: 11-17-05 From: Somewhere over there Last post: 6433 days Last view: 6432 days |
| ||
maybe try div class="banner" or something similar to that? I know for accessing all of my CSS settings, I use "class", not "style". | |||
Xkeeper Took the board down in a blaze of glory, only to reveal how truly moronical ||bass is. Since: 11-17-05 From: Henderson, Nevada Last post: 6432 days Last view: 6432 days |
| ||
background: url("bullshit"); | |||
Elric Octoballoon Since: 11-18-05 From: Melniboné Last post: 6830 days Last view: 6461 days |
| ||
Hmm... it seems there are different ways to call things for a < tag... TGWD uses < , Sukasa uses < , and I use < for this layout. However, for my post-Chirstmas layout, I'm using < . That's probably the proper one...
OK, I just did a quick test on a local HTML page, and < was the only one that worked.
Also, as Xk said, use .banner { width: 468; height: 60; background: url('schemes/night/banner.png');} or the image won't display. |
|||
Deleted User Banned Since: 05-08-06 Last post: None Last view: 6432 days |
| ||
I tried what Xk said, gave me correct height/width but no picture. So I tried:
<table><td class=banner></td></table> Same thing, correct width/height but no background... EDIT- Nevermind, it needed: background: url(../schemes/night/banner.png); Thanks guys. (edited by TheGreatWhiteDope on 12-21-05 12:32 PM) |
|||
Elric Octoballoon Since: 11-18-05 From: Melniboné Last post: 6830 days Last view: 6461 days |
| ||
I posted the proper code you needed at the end of my post.
Although it seems you needed a .. before the schemes/ :{ |
|||
Black Lord + Flurry Since: 11-17-05 From: Where indians still roam... Last post: 6433 days Last view: 6434 days |
| ||
Originally posted by Elric You need to go look at some CSS documentation... style/class/id are not the same thing. |
|||
MisterJones Tooky Since: 12-08-05 From: Mexico Last post: 6522 days Last view: 6458 days |
| ||
For a little clarification:
style is an html atrribute, providing inline "css" styling. Rather pointless, lacks a lot of control. class is meant for generic elements that would reuse the same styling. It provides eliminate ambiguosity (SP?) like treating a paragraph element different depending on context (although you could use also inherited elments styling). id is an address for an specific unique element (like my reduncancy?) that would have one and only one instance in your page. Call it a header, a footer, a navigation bar, whatever. Plus, divs are overused. Every html elemnt can use styling, goddammit, use proper semantics. (edited by MisterJones on 12-22-05 01:31 PM) |
|||
Elric Octoballoon Since: 11-18-05 From: Melniboné Last post: 6830 days Last view: 6461 days |
| ||
I'll let you both know when I give a damn. |
Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Programming - Images in CSS? | | |