School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,103 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,999 people online right now. Registration is fast and FREE... Join Now!




images are line wrapping

 

images are line wrapping

chitalian701

25 Oct, 2009 - 05:04 PM
Post #1

New D.I.C Head
*

Joined: 7 Oct, 2009
Posts: 3

I've just started to code in html and I am working on building a small website.

I made an image navigation bar that highlights whichever image is being hovered over, but to do this i had to make a separate image for each link. The only problem is that when i make the browser small, the images go to different lines.

There has to be a better way to code this, but I have no idea what it is.

Here's the code:

CODE

<div id="navbarbg" style="position:relative; top:170px; text-align:center;"/>
<img src="blank.jpg" width=700px height=50px/>
</div>

<div id="navbar" width=700px style="position:relative; top:120px; text-align:center;"/>
<a href="http://www.google.com">
<img src="home.jpg" border=0 width=100px height=50px
onmouseover="this.src='homeh.jpg'"
onmouseout="this.src='home.jpg'"/></a>
<a href="http://google.com">
<img src="paintings.jpg" border=0 width=100px height=50px
onmouseover="this.src='paintingsh.jpg'"
onmouseout="this.src='paintings.jpg'"/></a>
<a href="http://www.google.com">
<img src="sculpture.jpg" border=0 width=100px height=50px
onmouseover="this.src='sculptureh.jpg'"
onmouseout="this.src='sculpture.jpg'"/></a>
<a href="http://ww.google.com">
<img src="graphics.jpg" border=0 width=100px height=50px
onmouseover="this.src='graphicsh.jpg'"
onmouseout="this.src='graphics.jpg'"/></a>
<a href="http://www.google.com">
<img src="contact.jpg" border=0 width=100px height=50px
onmouseover="this.src='contacth.jpg'"
onmouseout="this.src='contact.jpg'"/></a>
</div>


The first div is just the background for the bar.

Any help would be greatly appreciated.

User is offlineProfile CardPM
+Quote Post


iphoneorange

RE: Images Are Line Wrapping

25 Oct, 2009 - 05:53 PM
Post #2

D.I.C Head
Group Icon

Joined: 20 Aug, 2008
Posts: 145



Thanked: 17 times
Dream Kudos: 75
My Contributions
you could use <NOBR> or in CSS white-space: nowrap; they both should fix the problem

hope i helped biggrin.gif

This post has been edited by iphoneorange: 25 Oct, 2009 - 05:54 PM
User is offlineProfile CardPM
+Quote Post

thehat

RE: Images Are Line Wrapping

26 Oct, 2009 - 06:01 AM
Post #3

awake ? web();
Group Icon

Joined: 28 Feb, 2008
Posts: 940



Thanked: 99 times
Dream Kudos: 200
My Contributions
You can use the css min-width rule on the containing div. Also, don't set the div's width like you are, set it in the style attribute.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 12:27PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month