Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

[Html/css] Horizontal list

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

liam_d

The original NP Emo KidEstablished Member
Impact
25
Hi all i am having problems making a horizontal list.

It works fine if i have say an avatar or a name so
*name *name *name etc

But if i have say
*avatar *avatar
*name *name

With the avatar and name seperated by a "<br />" then it will mess up the next list item :(.

My code is as follows (without the br):
Code:
		<ul id="friendslist">
		
			<li><img src="http://forum.prxa.info//images/noavatar.gif" alt="avatar" />
			<a href="profile.php?info=8">Tom1</a>
			</li>
			 
			<li><img src="http://forum.prxa.info//images/noavatar.gif" alt="avatar" />
			<a href="profile.php?info=29">Psybadek</a>
			</li>

			 
			<li><img src="http://forum.prxa.info//images/noavatar.gif" alt="avatar" />
			<a href="profile.php?info=14">haseeb</a>
			</li>
			
		</ul>

Code:
#friendslist

{

	padding:0;

	margin:0;

	white-space:nowrap;

	list-style-type:none;

}



#friendslist li 

{

	display:inline;

}

What am i doing wrong?
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Try this

Code:
<ul id="friendslist">
		
			<li><img src="http://forum.prxa.info//images/noavatar.gif" alt="avatar" /><br />

			<a href="profile.php?info=8">Tom1</a>
			</li>
			 
			<li><img src="http://forum.prxa.info//images/noavatar.gif" alt="avatar" /><br />
			<a href="profile.php?info=29">Psybadek</a>
			</li>

			 
			<li><img src="http://forum.prxa.info//images/noavatar.gif" alt="avatar" /><br />
			<a href="profile.php?info=14">haseeb</a>
			</li>
			
</ul>

And for the CSS

Code:
#friendslist

{

	padding:0;

	margin:0;

	white-space:nowrap;

	list-style-type:none;
	float:left;

}



#friendslist li 

{
float:left;
	display:inline;
	padding:10px;

}

You need to have the float:left; property.
 
0
Close
while that works for the stacking, it seems to put the menu in the div below it?
 
Last edited:
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back