user3617097
user3617097

Reputation: 115

Placing a Menu beside a image in html and css

I have an image that i have displaying at top of the webpage.Now i want to show one menu button id beside to the image but i am not able to do it.Menu button is coming down in next line..

Here is the HTML..

  <img src="images/hotelAwadh.png" alt="logo" width="150" height="50">
  <div id="result_data"></div>

How to display <div id="result_data"></div> beside to img .

Please help me ..

Upvotes: 0

Views: 370

Answers (2)

valerio0999
valerio0999

Reputation: 12138

div is a block element and it takes 100% width by default. img is an inline element by default and it occupies its very specific width/height. what you have to do is overwrite their default behaviours with display:inlineand display:block

img {float:left;display:block}
div#result_data {float:left;display:inline;}

http://jsfiddle.net/v2N7v/

Upvotes: 0

Razvan B.
Razvan B.

Reputation: 6771

Use:

float:left;

On both your image and div

Upvotes: 3

Related Questions