CSS Layout – display: inline-block
The display: inline-block Value
Compared to display: inline
, the major difference is that display: inline-block
allows to set a width and height on the element.
Also, with display: inline-block
, the top and bottom margins/paddings are respected, but with display: inline
they are not.
Compared to display: block
, the major difference is that display: inline-block
does not add a line-break after the element, so the element can sit next to other elements.
The following example shows the different behavior of display: inline
, display: inline-block
and display: block
:
Example
span.a {
display: inline; /* the default for span */
width: 100px;
height: 100px;
padding: 5px;
border: 1px solid blue;
background-color: yellow;
}
span.b {
display: inline-block;
width: 100px;
height: 100px;
padding: 5px;
border: 1px solid blue;
background-color: yellow;
}
span.c {
display: block;
width: 100px;
height: 100px;
padding: 5px;
border: 1px solid blue;
background-color: yellow;
}
Using inline-block to Create Navigation Links
One common use for display: inline-block
is to display list items horizontally instead of vertically. The following example creates horizontal navigation links:
Example
.nav {
background-color: yellow;
list-style-type: none;
text-align: center;
padding: 0;
margin: 0;
}
.nav li {
display: inline-block;
font-size: 20px;
padding: 20px;
}
42 Responses
levofloxacin generic order generic levaquin 250mg
avodart 0.5mg generic order celebrex 200mg without prescription zofran 4mg without prescription
buy spironolactone without prescription valacyclovir 500mg pills fluconazole 200mg oral
ampicillin pills brand cephalexin 125mg buy erythromycin 500mg generic
cheap sildenafil 100mg order fildena 100mg for sale purchase methocarbamol for sale
sildenafil 100mg tablet buy generic estrace order estrace 1mg for sale
purchase lamictal pills purchase vermox online cheap cheap retin gel
order tadalafil 20mg without prescription tadalis generic buy voltaren 100mg generic
cheap accutane 40mg buy accutane 10mg online zithromax without prescription
indocin online buy buy amoxicillin 250mg online amoxicillin 500mg tablet
buy cialis 40mg online Viagra medication real viagra pills
oral arimidex Samples of viagra sildenafil without prescription
tadalafil 5mg prix viagra 50mg sans ordonnance en pharmacie acheter 100mg sildenafil en ligne
cheap deltasone 5mg buy generic sildenafil order viagra 100mg for sale
cialis kaufen ohne rezept original cialis 10mg rezeptfrei sicher kaufen sildenafil 50mg ohne rezept
isotretinoin 40mg brand stromectol oral ivermectin 3mg tablets
purchase modafinil pills provigil cost brand acetazolamide 250mg
buy doxycycline 200mg oral clomiphene 100mg order furosemide 40mg for sale
buy ramipril 5mg for sale cost ramipril 10mg buy astelin 10ml for sale
cost catapres 0.1mg buy generic meclizine buy tiotropium bromide 9mcg without prescription
order buspirone 10mg for sale buy amiodarone 200mg generic buy ditropan 5mg generic
terazosin over the counter purchase arava sale azulfidine 500mg generic
cheap fosamax 35mg paracetamol cheap pepcid pill
benicar 20mg cost order calan pill acetazolamide 250 mg oral
tacrolimus online trandate us order ursodiol 150mg pill
isosorbide pills isosorbide price order generic telmisartan 80mg
generic zyban 150mg buy generic seroquel buy quetiapine 100mg for sale
molnupiravir tablet naprosyn 500mg cost order prevacid for sale
sertraline 100mg price kamagra uk real viagra 100mg
buy generic cialis 40mg purchase fluoxetine online cheap buy viagra 50mg pills
cialis 20mg sale cialis without prescription amantadine online order
naltrexone 50 mg us letrozole ca purchase aripiprazole generic
order dapsone 100 mg generic nifedipine usa perindopril 4mg tablet
medroxyprogesterone over the counter cyproheptadine 4mg sale order periactin 4 mg for sale
modafinil 200mg uk order generic provigil 200mg ivermectin 50
buy isotretinoin pills deltasone online order deltasone 20mg generic
piracetam for sale viagra 100mg pill viagra 25mg
azithromycin 250mg ca azithromycin 250mg brand neurontin 800mg usa
cialis online buy viagra 100mg oral buy viagra pill
purchase lasix order doxycycline 200mg pill plaquenil 200mg generic
oral tadalafil 5mg betamethasone 20 gm cheap buy anafranil 25mg pill
dating chat site local free dating sites share dating absolutely free dating sites