CSS Questions - Width of an inline element

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

EricH

Established Member
Impact
1
Is it possible to set the width of an inline element in CSS? For example, the navbar on http://www.w3bids.com uses...

Code:
a.navbar {
	display:inline;
	text-decoration:none;
	text-align:center;
	font-size: 12px;
	background-image:
url('http://www.w3bids.com/templates/SmoothBlue/images/site/nav/buttons/button_off.gif');
	height:75px
	width:100px;
	border-style:none;
	padding:3px;
	margin-left: 0px;
	margin-right: 0px;
}

But, it doesn't actually set the width of each link to 100px for some reason. Now, if I did this with only changing "display" to "block" instead of inline, it would give me the width... but the buttons would be stacked which I obviously don't want. So, is it possible to set the "width" of an inline element using CSS?

For example, on http://www.txstart.com I used...

Code:
a.startmenu {
	display:block;
	text-decoration:none;
	text-align:left;
	background-color: #FFFBFF;
	width:150px;
	border-style:outset;
	padding:3px;
	margin-left: 0px;
	margin-right: 0px;
}

And it gives me set "button" widths. Is it because I have a "border-style" in the code as well?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back