Skip to main content

CSS/html horizontal list with image -


i trying have text display right of image using simple css , text displaying below image rather right. works okay text.

here jsfiddle - http://jsfiddle.net/ejn7u/

-which not seem show images--and text go right of alt text in img tag. can't figure out way display images in jsfiddle on own server, text displaying below image, not right.

would appreciate suggestions. thanks. here code:

.hlist li { display: inline-block; margin-left: auto; margin-right: auto; } <ul class="hlist"> <li><img src = "pic.jpg" alt="picture"></li><li>some text</li><li>some more text</li></ul> 

edited remove ul tag

css/html horizontal list image - stack overflow

learn, share, build

each month, on 50 million developers come stack overflow learn, share knowledge, , build careers.

join world’s largest developer community.

sign up

i trying have text display right of image using simple css , text displaying below image rather right. works okay text.

here jsfiddle - http://jsfiddle.net/ejn7u/

-which not seem show images--and text go right of alt text in img tag. can't figure out way display images in jsfiddle on own server, text displaying below image, not right.

would appreciate suggestions. thanks. here code:

.hlist li { display: inline-block; margin-left: auto; margin-right: auto; } <ul class="hlist"> <li><img src = "pic.jpg" alt="picture"></li><li>some text</li><li>some more text</li></ul> 

edited remove ul tag

share|improve question
1  
a ul not valid child of ul element; child ul should contained within li (the only valid child of ul or ol). showing images on js fiddle, have use absolute path (http://www.example.com/path/to/image.png), pic.jpg doesn't exist on server. – david thomas jul 6 '12 @ 23:30
    
sorry, ul typo. still having issue img. – user1260310 jul 6 '12 @ 23:35
    
what problem? text displaying right of image in linked js fiddle, unless 'below' meant image , text aren't vertically-centred? if problem on own server, need link server, or work out what's different between server , js fiddle. – david thomas jul 6 '12 @ 23:37
    
yes, put google image in , working on jsfiddle. problem must elsewhere in code on page... – user1260310 jul 6 '12 @ 23:40
1  
no, when click 'save' generates new save point updated/new code; otherwise nothing saved when leave fiddle. – david thomas jul 6 '12 @ 23:54

your answer

 
discard

posting answer, agree privacy policy , terms of service.

browse other questions tagged or ask own question.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -