首页 > Web开发 > 详细

CSS:Tutorial three

时间:2019-03-09 21:09:32      阅读:181      评论:0      收藏:0      [点我收藏+]

1、CSS Links

links can be styled differently depending on what state they are in.

The four links states are:

  • a:link - a normal, unvisited link
  • a:visited - a link the user has visited
  • a:hover - a link when the user mouses over it
  • a:active - a link the moment it is clicked

Text Decoration

The text-decoration property is mostly used to remove underlines from links:

a:link {
  text-decoration: none;
}

a:visited {
  text-decoration: none;
}

a:hover {
  color:red;
  text-decoration: underline;
}

a:active {
  text-decoration: underline;
}

Advanced - Link Buttons

This example demonstrates a more advanced example where we combine several CSS properties to display links as boxes/buttons:

a:link, a:visited {
  background-color: #f44336;
  color: white;
  padding: 14px 25px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

a:hover, a:active {
  background-color: red;
}

技术分享图片

 

2、CSS Lists

HTML Lists and CSS List Properties

In HTML, there are two main types of lists:

  • unordered lists (<ul>) - the list items are marked with bullets
  • ordered lists (<ol>) - the list items are marked with numbers or letters

The CSS list properties allow you to:

  • Set different list item markers for ordered lists
  • Set different list item markers for unordered lists
  • Set an image as the list item marker
  • Add background colors to lists and list items

Different List Item Markers

The list-style-type property specifies the type of list item marker.

The following example shows some of the available list item markers:

ul.a {
  list-style-type: circle;
}

ul.b {
  list-style-type: square;
}

ol.c {
  list-style-type: upper-roman;
}

ol.d {
  list-style-type: lower-alpha;
}

技术分享图片

An Image as The List Item Marker

The list-style-image property specifies an image as the list item marker:

ul {
  list-style-image: url(‘sqpurple.gif‘);
}

 

CSS:Tutorial three

原文:https://www.cnblogs.com/Nyan-Workflow-FC/p/10502856.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!