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.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 03-21-2007, 09:52 PM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
CSS Help

Im new to CSS but a friend started me off. So what I want to do is add some pictures as a menu and make them hyperlinked.. I have a news/blog thing on my site so this menu will be next to it, looks like so... http://img157.imageshack.us/img157/5249/sm3vp1.jpg

But im stuck here, How do i add other images without the first one disappearing? Also want to make them hyperlinked to another part of the site. If you need to see my site ill post link..

This is the code I got from a friend;
Code:
<style type="text/css"> body { background-image: url('/images/SM3_01.gif'); background-repeat: no-repeat; background-position: 174px 148px; } </style>
Help a newbie? lol

edit: forgot to mention that the menu image is sliced up in Photoshop and will be in peices
 
Reply With Quote
  #2 (permalink)  
Old 03-22-2007, 01:02 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
If you want to do it with css you can make a div with the menu image as a background and make it clickable with a simple javascript line, or create a div, postition it where you want and put a <a href> in it with the image.
the easiest would be something like this:
Code:
<div style="width:200px"> <a href="#"><img src="link1.jpg"></a><br> <a href="#"><img src="link1.jpg"></a><br> </div>
__________________
I still got me a signature to fill
 
Reply With Quote
  #3 (permalink)  
Old 03-22-2007, 01:33 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
OK now im even more confused. lol.

my site involves a little php script aswell as html, I tried what you said, but couldnt get it to appear in the correct place.

This is my site, if it helps you understand what im saying. http://www.smp.game-host.org/
 
Reply With Quote
  #4 (permalink)  
Old 03-22-2007, 01:51 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
The easiest way is probably to create a main #div container of 750px or so, and place you're content form left to right
easy example
Code:
<style> #container { width:750px; margin:0 auto; } #menu { width:150px; float:left; } #content { width:450px; float:left; } </style> <div id="container"> <div id="menu">you're menu stuff</div> <div id="content">your content</div> </div>
__________________
I still got me a signature to fill
 
Reply With Quote
  #5 (permalink)  
Old 03-22-2007, 02:47 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Ive thought of doing it that way, But I dont really like the way its layout, personally I like the side menu better, But thanks anyway.
 
Reply With Quote
  #6 (permalink)  
Old 03-22-2007, 02:48 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
so when the user scales their browser your side menu will overlap everything?
__________________
I still got me a signature to fill
 
Reply With Quote
  #7 (permalink)  
Old 03-22-2007, 02:52 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Hmm I never thought of that, Ill have to ask my friend how they stopped theirs from moving when the brower is scaled down.
 
Reply With Quote
  #8 (permalink)  
Old 03-22-2007, 02:54 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
well, I know one way ^^

theres just this age old problem that surfers use different resolutions etc.
The 800/600 percentage is dropping though, thank god
__________________
I still got me a signature to fill
 
Reply With Quote
  #9 (permalink)  
Old 03-22-2007, 02:59 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Yes thats one reason why I make all my sites in 800x600, I know a few people who still live in that age lol, And whats your way?
 
Reply With Quote
  #10 (permalink)  
Old 03-22-2007, 03:19 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
that was post #4, keep it all in a main div of less than 800px wide
__________________
I still got me a signature to fill
 
Reply With Quote
  #11 (permalink)  
Old 03-22-2007, 03:46 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Ok.. Just a lil question, how do i add more than one image using the code like in post #1, making each appear at a differnt locaction?
 
Reply With Quote
  #12 (permalink)  
Old 03-22-2007, 06:11 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
in post 1 you're using a background image in your body tag, and you only have 1 body,

You can use divs or table cells and place images in those
__________________
I still got me a signature to fill
 
Reply With Quote
  #13 (permalink)  
Old 03-23-2007, 03:09 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
So how I use divs with that first code? i think the divs are like <div> </div> right?
 
Reply With Quote
  #14 (permalink)  
Old 03-23-2007, 03:17 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
well, you have to define a div first in your stylesheet.css for example:
Code:
.textbox { font-family:verdana; }
and then in your html:
Code:
<div class="textbox"> your content </div>
you can ad more functions in your class like the background image etc
__________________
I still got me a signature to fill
 
Reply With Quote
  #15 (permalink)  
Old 03-23-2007, 03:41 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Ok thanks, so the "textbox" bit I can change to anything? i would just have to change this to the same aswell? .textbox {
 
Reply With Quote
  #16 (permalink)  
Old 03-23-2007, 03:43 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
yeah it's just an example, it could be .goatherder if you want
__________________
I still got me a signature to fill
 
Reply With Quote
  #17 (permalink)  
Old 03-23-2007, 03:51 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Ah ok thanks, I was just checking
 
Reply With Quote
  #18 (permalink)  
Old 03-23-2007, 03:55 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
you can find alot of info about css here
__________________
I still got me a signature to fill
 
Reply With Quote
  #19 (permalink)  
Old 03-23-2007, 04:11 AM
Junior Member
 
Join Date: 03-21-07
Location: Australia
Posts: 26
iTrader: 0 / 0%
Thanks, been looking through that site, But it doesnt say how you position a image using pixels or % values.

Ive made it so its not an internal CSS, easier to work with now.

Only what I have in it so far;
Code:
body { background-image: url('/images/SM3_01.gif'); background-repeat: no-repeat; background-position: 174px 148px; } .image01 { background-position: 174px 248px; }
Though I thought the background would work the same with the image01 code, guess not lol.
 
Reply With Quote
  #20 (permalink)  
Old 03-23-2007, 04:18 AM
Tomassi's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 01-26-06
Location: Alkmaar
Posts: 2,506
iTrader: 0 / 0%
the width and height statement you're using will use the outer div or body as a starting point,
like you had in your body the background image will be placed 174px from the left side of your browser, no matter what the size/scale is.
You should try to avoid that cause it will overlap your content.
If I were you you should use my example in post #4 as a basis and continue from there.

You can ad classes in classes to place images etc, and you don't need to use the background statement to call an image every time.
__________________
I still got me a signature to fill
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



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


All times are GMT -7. The time now is 02:42 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.