Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Closed Thread
 
Thread Tools Display Modes
Share |
  #1  
Old 03-21-2013, 06:38 PM
seraphim seraphim is offline
Junior Member
 
Join Date: 03-21-13
Posts: 2
iTrader: 0 / 0%
Question I know this is simple, But please HELP

So I'm very new to html, LIKE REALLY NEW, so that's why I have this simple question, ( I'm assuming it is. )

So I'm trying to include a background image in my " <div id="header"> " tag.
I have no clue how this is done, I googled it, and looked it up and still no luck.
Please help me! Thanks
Here's what I have so far,

--------
HTML Code:
<!DOCTYPE html> <html> <head> <style type="text/css"> a {color:black} p {color:black;fontsize:20Px;} h1 {color:white} </style> </head> <body> <center> <div id="container" style="width:800px;"> </div> <div id="header"> <h1>DLK Electric</h1> </div> <h3 style="font-size:24px;"> We do it right-the first time. </h3> <div id="menu" style="background-color:red;width:82px;height:125px;float:left;"> <table border="2" style="font-size:20px;"> <tr><th>Home</th></tr> <tr><th>About</th></tr> <tr><th>Services</th></tr> <tr><th>Contact</th></tr> </table> </div> </br> </br> </br> <div id="content"> </center> </body> </html>
-----------------

Last edited by HTMLBasicTutor; 03-21-2013 at 08:05 PM.
 

Advertisement

Advertisement

  #2  
Old 03-22-2013, 03:01 AM
GMF's Avatar
GMF GMF is offline
Contributing Member
 
Join Date: 11-03-11
Location: Austria
Posts: 1,213
iTrader: 0 / 0%
It's actually quit simple

Since you already have an id on your div, just add a CSS attribute

Code:
#header { background-image: url(./path/to/image.png);
 
  #3  
Old 03-22-2013, 05:27 AM
Frankie GTH Frankie GTH is offline
Junior Member
 
Join Date: 03-14-13
Posts: 18
iTrader: 0 / 0%
Quote:
Originally Posted by seraphim View Post
So I'm very new to html, LIKE REALLY NEW
Then why not start with a free beginner's course at w3schools-dot-com? Looking at your code, you could certainly use it -- your code won't validate, it uses a table for the menu and it uses inline styles.
 
  #4  
Old 03-22-2013, 05:56 AM
GMF's Avatar
GMF GMF is offline
Contributing Member
 
Join Date: 11-03-11
Location: Austria
Posts: 1,213
iTrader: 0 / 0%
Quote:
Originally Posted by Frankie GTH View Post
Then why not start with a free beginner's course at w3schools-dot-com? Looking at your code, you could certainly use it -- your code won't validate, it uses a table for the menu and it uses inline styles.

While w3school is improving, I would advise against learning from it. There are better sites to start, like

Code:
www.htmldog.com

 
  #5  
Old 03-22-2013, 07:34 AM
abraham26 abraham26 is offline
Member
 
Join Date: 01-24-13
Posts: 42
iTrader: 0 / 0%
id use #
class use .

Quote:
<style type="text/css">

#header{
background-image:url('../images/my_image.png');
}

</style>
 
  #6  
Old 03-22-2013, 07:51 AM
Frankie GTH Frankie GTH is offline
Junior Member
 
Join Date: 03-14-13
Posts: 18
iTrader: 0 / 0%
Quote:
Originally Posted by GMF View Post
While w3school is improving, I would advise against learning from it. There are better sites to start, like
Code:
htmldog
I disagree. In terms of didactics and completeness, nothing beats w3schools. The fact that a couple of nerds found a few omissions and even an occasional mistake doesn't change that. That's quite normal on a site that consists of hundreds of pages, covering a multitude of that of topics.
 
  #7  
Old 03-22-2013, 08:03 AM
GMF's Avatar
GMF GMF is offline
Contributing Member
 
Join Date: 11-03-11
Location: Austria
Posts: 1,213
iTrader: 0 / 0%
Quote:
Originally Posted by Frankie GTH View Post
I disagree. In terms of didactics and completeness, nothing beats w3schools. The fact that a couple of nerds found a few omissions and even an occasional mistake doesn't change that. That's quite normal on a site that consists of hundreds of pages, covering a multitude of that of topics.
Why learn from a source that is not 100% accurate when you can learn from one that pretty much is?


W3school is a good reference site, but not the one I'd suggest a newcomer to go an learn from. As I said before, there are better sites (like htmldog)
 
  #8  
Old 03-22-2013, 06:24 PM
seraphim seraphim is offline
Junior Member
 
Join Date: 03-21-13
Posts: 2
iTrader: 0 / 0%
Thanks all of you, especially GMF

It now works and displays the image correctly exactly the way I wanted it.
Thanks!
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Web Design with Simple Rules webcosmo Web Design Lobby 3 10-19-2008 12:00 AM
Simple PHP Sketch Coding Forum 1 09-09-2008 06:29 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 04:28 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC