标签内的另一个标签html

a tag inside another tag html

本文关键字:标签 html 另一个      更新时间:2023-09-26
.button1{

  background: #E68A00 url(wooden.jpg) repeat-x;
  border: 2px solid #eee;
  height: 28px;
  width: 115px;
  margin: 50px 0 0 50px;
  padding: 0 0 0 7px;
  overflow: hidden;
  display: block;
  text-decoration:none;
  font-family: 'Sacramento', cursive;
  color : white;
  font-size: 30px;


  /*Rounded Corners*/
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
/*Gradient*/
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
/*Transition*/
-webkit-transition: All 0.5s ease;
-moz-transition: All 0.5s ease;
-o-transition: All 0.5s ease;
-ms-transition: All 0.5s ease;
transition: All 0.5s ease;

}
pg.button1{ 
position:absolute;
right:0px;
top:100px;
}
pg:hover {
  width: 200px;
}



<pg <a class = "button1" href="http://www.google.com">Small $14 </a>  </pg>## Heading ##

上面的标签是一个链接,直到我引入了标签pg,这意味着在屏幕上定位链接。原因是我仍然希望将类与其他对象一起使用!所以我不需要复制我的代码!我已经创建了像p1 p2 p3 p4这样的标签来使用同一个类它实际上定位它,但它不再是一个链接!为什么呢?我怎么才能让它恢复工作呢?

与其发明新的标签,不如使用多个类。在本例中,根据实际要做的事情,您可以这样做:

<a class="button1 pg" href="...">Small $14</a>

或:

<div class="pg"><a class="button1" href="...">Small $14</a></div>