(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-20-24 11:45 AM
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: 6301 days
Posted on 12-20-05 11:35 PM Link | Quote
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: 6301 days
Last view: 6300 days
Posted on 12-21-05 12:59 AM Link | Quote
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: 6300 days
Last view: 6300 days
Skype
Posted on 12-21-05 01:04 AM Link | Quote
background: url("bullshit");
Elric

Octoballoon


 





Since: 11-18-05
From: Melniboné

Last post: 6698 days
Last view: 6330 days
Posted on 12-21-05 01:19 AM Link | Quote
Hmm... it seems there are different ways to call things for a <div> tag... TGWD uses <div style="name">, Sukasa uses <div class="name">, and I use <div id=name> for this layout. However, for my post-Chirstmas layout, I'm using <div class=name>. That's probably the proper one...

OK, I just did a quick test on a local HTML page, and <div class="name"> 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: 6301 days
Posted on 12-21-05 01:27 PM Link | Quote
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: 6698 days
Last view: 6330 days
Posted on 12-21-05 09:49 PM Link | Quote
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: 6302 days
Last view: 6303 days
Posted on 12-22-05 12:49 PM Link | Quote
Originally posted by Elric
Hmm... it seems there are different ways to call things for a <div> tag... TGWD uses <div style="name">, Sukasa uses <div class="name">, and I use <div id=name> for this layout. However, for my post-Chirstmas layout, I'm using <div class=name>. That's probably the proper one...

OK, I just did a quick test on a local HTML page, and <div class="name"> 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.


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: 6390 days
Last view: 6326 days
Posted on 12-22-05 02:30 PM Link | Quote
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: 6698 days
Last view: 6330 days
Posted on 12-22-05 04:47 PM Link | Quote
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? |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.008 seconds; used 385.84 kB (max 471.35 kB)