html - CSS auto-increment block width -


i've been trying learn basic css/html making myself static web page. @ bottom of page want show few 32x32 image icons of websites go to.

i want display them inline , put them in center of page. right have 3 icons created block of width 96 (= 32x3) , center container block.

however think there's chance i'll need add more icons list, means every time new icon added, need recalculate width of container block. i'm wondering if there rule in css save me doing that?

for example text-align: center text field regardless of how many words put in there. there similar image blocks?

thanks much!

update

as in cbp's answer, text-align works img tags. pointing out!

however (sorry not having made clear before), didn't use <img> rather <a> css setting background images. guess 2 follow-up questions:

1) text-align: center still apply here? 2) preferable use <a> (with css background-image) on raw html <img>? advantage use either?

thanks again!

by default text-align: center have same effect on images on text, img tags have display: inline default.

so can make element contains imgs have width: 100%, give text-align: center.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -