Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : CSS questions.
New Topic New Poll Post Reply
Poster Message
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon CSS questions. (0)  
I find that sometimes I really only need a div element to show some image how I like, but the div element won't appear in the browser unless some other HTML element is enclosed by the div. So for example, this tag would be cool if it worked:

<div style="position: absolute; left: 0px; top: 0px; background-image: dog.jpg;" />


...but instead I have to do something like this:

<div style="position: absolute; left: 0px; top: 0px;"><img src="dog.jpg" /></div>


My general problem is that I would like to specify div tags without requiring another element to be enclosed. Or alternatively, just some simple workaround to cut down on HTML code clutter would be good. Suggestions?

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
01-30-2005 at 11:29 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: CSS questions. (+1)  
Elements usually don't show up if they don't have a size. If you specify the width and height of the div in its style, it should show up. (The size of a div is defined by the size of its children, so with no children the size is unspecified unless you specify it.)

- Gerry

[Edited by trick at Local Time:01-30-2005 at 11:55 PM]
01-30-2005 at 11:53 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: CSS questions. (0)  
You know, I coulda swore I tried that, but maybe I didn't before. Now my div works after specifying width/height as suggested. Thanks!

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
01-31-2005 at 12:12 AM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : CSS questions.
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.