Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turn This Into Css 1

Status
Not open for further replies.

MasumX

Programmer
Feb 19, 2005
26
0
0
US
how do i code it in CSS this with vspace? and call the image from "Css" so that i can random the page with Style Sheet? on change stylesheet it will change the skin of my page...im stuck on this :( so can anyone help me? thanks!

<img src="images/line.gif" alt="" width="119" vspace="2" />


 
How are you calling the random image with HTML?
Does the image relate to whatever style you are using?
When you call the random stylesheet, could you not also call a corresponding image?
Or is the image part of the "background" graphics?

You could write a server side script that outputs an image filename and include that as a background attribute to an element within the CSS.

For instance, in psuedo-code:

Code:
Call this script "randomImage.php" (as an example)

Set up an array with a list of image path/filenames

Pick a path/filename at random from the array and output it's name

Then in your CSS

Code:
myRandomImageElement {
    background:url(path/to/randomImage.php) top left no-repeat;
}


Something like that. I've not tested it but I think that sort of thing would work.

Foamcow Heavy Industries - Web design and ranting
Toccoa Games - Day of Defeat gaming community
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
"I'm making time
 
i think so lol..umm i wont RANDOM the image i will switch the stylesheet and the image will change as with the CSS :) so i just need something like i dnt no how u do it something like

#img {
width: 119px; 1px;
margin ( i need for top and bottom)
background: url (whatever.gif);
}

so i can put in my XHTML tag as

<div id=img></div> and it will show the image :D with vspace from top and down :)
 
oh btw is this possible ?

<table border="0" cellpadding="0" width="746" style="border-collapse: collapse">

<table cellspacing="1" width="746">

to turn it into css way? if so plz do it for me plz thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top