CSS navigation bar

Using CSS you can transform it into a beautiful navigation bar instead of a boring HTML menu.

Use html and css to create a horizontal navigation bar

##li Set float:left;

    php.cn  

Remarks:

①You can set margin for ul, but when set to margin:100px auto, ul cannot be centered②ul has a height of 0.
③ You can set the width for li and adjust the width freely.
④You can set margin for li so that there is space between li.
⑤You can set display:block for a; make the whole area clickable.
⑥If you want the links to have the same size, you must use float instead of display:inline;

li to set display:inline-block;

    php.cn  

Remarks:①Set margin:100px auto for ul; you can center ul on the left and right.
② Even if li has no margin, there will still be spaces between each li.
③You can set display:block; on a to make the whole area clickable.


Use html and css to create a vertical navigation bar

    php.cn     


Inline list:

    php.cn   
  • 奇才
  • 村村
  • 天干
  • 才工
  • 雪原



##

Continuing Learning
||
php.cn
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!