The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. October 16, 2019, 04:32:28 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: How to superimpose html on top of a background image  (Read 4912 times)
ispyguy757
Rookie
**
Offline Offline

Posts: 10


View Profile
« on: August 06, 2009, 01:18:24 PM »

I know this is a SERIOUS noob question, but i want to have a single image of say 600x400
as the background for a page and then to put html on top of it .... can someone point me
in the right direction?

 Need Help
Logged

No links in signatures please
rcjordan
Lifer
*****
Offline Offline

Posts: 882


View Profile
« Reply #1 on: August 06, 2009, 01:49:19 PM »

try http://www.w3schools.com/css/pr_background-position.asp
Logged
isthisthingon
Global Moderator
Lifer
*****
Offline Offline

Posts: 2879



View Profile
« Reply #2 on: August 06, 2009, 02:44:51 PM »

Yep, w3schools is the place to live: http://www.w3schools.com for just about everything.
Logged

I would love to change the world, but they won't give me the source code.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: August 06, 2009, 03:03:21 PM »


<style>
#mainDiv {
   height: 100%;
   width: 100%;
   background-image: url(/graphics/myImage.jpg);
   background-position: 50% 50%;
   background-repeat: no-repeat;
   padding: 20px;
   font-family: Arial;
   font-size: 14px;
   font-weight: bold;
}
</style>

<div id="mainDiv">
Four score and seven years ago, our fathers brought forth to this country, a new nation,
conceived in liberty and dedicated to the proposition that all men are created equal.
</div>


Any div can have a background image, just as the BODY can. Lookup background-image and associated CSS declarations for more data.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
rcjordan
Lifer
*****
Offline Offline

Posts: 882


View Profile
« Reply #4 on: August 06, 2009, 03:09:38 PM »

>any div

Same for tables and table cells. Call them by id or, more generically, by class. Because of the built-in nesting of <table><tr><td> you can do some pretty spiffy background effects and still have it KISS.
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #5 on: August 06, 2009, 03:23:47 PM »

I'd have thought you'd be past tables by now RC, since there seems to be plenty of antilove evidence at the googleplex for them...
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
rcjordan
Lifer
*****
Offline Offline

Posts: 882


View Profile
« Reply #6 on: August 06, 2009, 04:04:12 PM »

Can't give 'em up just yet, though I am on a 12-step program for table addicts. Divs too flakey for ramming and jamming content onto the page. And -thankfully- G still seems to cut old, established domains some slack on rank.
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #7 on: August 06, 2009, 05:19:07 PM »

I decided to bite the bullet and go all CSS about a year ago. About 6 full months of pain, now it's the only way to go. It is way better, and given some of our discussions of other pursuits, I can tell you that the rewards are worth the effort.

If you want, we could go voice and I could assist you. I also had a NASTY f'ing time cutting from tables, but once I did, it was hugely liberating. It's worth it, I assure you.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
rcjordan
Lifer
*****
Offline Offline

Posts: 882


View Profile
« Reply #8 on: August 07, 2009, 10:30:02 AM »

>assist

Thanks but I'll save your help offer for something more dire.

I need a new template for the cms anyway and it'll be table-less ....thinking of going with the fake newspaper look.
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!