添加大纲时为什么<p>这么久?

时间:2017-06-22 19:55:04

标签: html css paragraph

我正在制作一个网站,有些东西很烦人......这里是代码:

&#13;
&#13;
.log {
      color: #FF00FC;
      font-family: Josefin Regular;
      font-size: 12.8pt;
      outline: 3.2px solid #ff00fc;
      padding: 6px;
      position: relative;
      top: 400px;
      left: 10px;
      transform: rotate(10deg);
      z-index: 0;
}
&#13;
<p class='log'>>_</p>
&#13;
&#13;
&#13;

出于某种原因,<p>这么长,它占用的频率超过了屏幕。如何使outline:更小以适应我的喜好?我希望它不那么广泛。谢谢,我希望你明白。

3 个答案:

答案 0 :(得分:6)

默认情况下,p元素显示为块。如果您将显示设置为inline-block,则应该解决问题:

.log {
      color: #FF00FC;
      font-family: Josefin Regular;
      font-size: 12.8pt;
      outline: 3.2px solid #ff00fc;
      padding: 6px;
      position: relative;
      top: 400px;
      left: 10px;
      transform: rotate(10deg);
      z-index: 0;
      
      display:inline-block
}
<p class='log'>>_</p>

答案 1 :(得分:5)

display更改为inline-block

.log {
  display: inline-block;
  color: #FF00FC;
  font-family: Josefin Regular;
  font-size: 12.8pt;
  outline: 3.2px solid #ff00fc;
  padding: 6px;
  position: relative;
  top: 400px;
  left: 10px;
  transform: rotate(10deg);
  z-index: 0;
}
<p class='log'>>_</p>

默认情况下,display: block会应用于<p>,当positionrelative static.log时,会导致其覆盖整个容器的宽度。

或者,如果position: relative的父级是position: absolute,则可以将其更改为display: inline-block,而您无需申请body { position: relative; } .log { color: #FF00FC; font-family: Josefin Regular; font-size: 12.8pt; outline: 3.2px solid #ff00fc; padding: 6px; position: absolute; top: 400px; left: 10px; transform: rotate(10deg); z-index: 0; }

<p class='log'>>_</p>
output <- array(, dim=c(192,94,12,160))# need to change this to   length(Lat), etc

N <- length(filelist)     # Loop over the individual files
for(j in 1:N){

  File<-nc_open(filelist[j])
  print(filelist[j])  
  Temperature<-ncvar_get(File,"t2m")
  Lat<-ncvar_get(File, "lat")
  Lon<-ncvar_get(File,"lon")
  Time<-ncvar_get(File,"time")
  Year<-c(1851:2010)
  EnsambleNo.<-ncvar_get(File,"ensemble_member")
  Temperature
  Lat<-round(Lat,digits = 2)
  Lon<-round(Lon,digits = 2)
  Ensamble1<-Temperature[,,1,] #The Ensamble wanted, 1 to 56
  Ensamble1<-round(Ensamble1,digits = 1)
  dimnames(Ensamble1)<-list(Lon,Lat,Time)
  dimnames(output) <- list(Lon,Lat,Time,Year)
  }

  print(Ensamble1) 

答案 2 :(得分:3)

p元素默认为display: block;,它将占用流量允许的宽度。通过在display: inline-block;规则中添加.log,可以解决此问题。