【发布时间】:2016-12-06 12:44:44
【问题描述】:
我正在尝试制作网站的页脚。在图像中,您可以看到它应该是怎样的,以及我得到了什么。我试图获取名为 secretarias 的 div 的位置和名为 direita 的 div 的位置,因为我希望我的蓝色 div 在这两个周围着色,就像在图像中一样。
但是 jquery 的位置不起作用。而且我什至不确定这是一个很好的方法。我只想为这两个 div 周围的颜色多着色几个像素,并在周围设置圆形边框。
另外:我无法让 div "rights" 在中心完全对齐。它是唯一有问题的,因为它的字体大小必须比其他字体小一点。
/*
var position = $("#secretarias").position();
var bottom_l = position.bottom;
var left_l = position.left;
$("#rodapecor01").css("bottom: ",bottom_l, "left: ",left_l);
var position2 = $("#direita").position();
var bottom_r = position2.bottom;
var left_r = position2.left;
$("#rodapecor02").css("bottom: ",bottom_r, "left: ",left_r);
I couldn't make my JQuery work here but you can check it on the fiddle: http://jsfiddle.net/o2gxgz9r/552/
*/
#rodape {
position: absolute;
bottom: 0;
width: 100%;
height: 27.5%;
background: #e7e7dc;
font-size: 3vh;
font-family: PT_Sans-Web-Regular;
text-align: center;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
}
#organizador {
width: 48.60015522%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
flex-flow: row nowrap;
justify-content: space-around;
}
#centro {
width: 90%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
flex-flow: row nowrap;
justify-content: flex-start;
}
#secretarias {
width: 11.95230368%;
background: #541324;
color: white;
text-align: right;
}
.linha {
width: 4%;
text-align: center;
}
.menurodape {
text-align: center;
}
#direita {
width: 39.4475411%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
flex-flow: row nowrap;
justify-content: space-between;
background: #541324;
color: white;
}
#mapadosite {
}
#rights {
font-size: 1.5vh;
text-align: center;
}
#rodapecor01 {
/* background:#541324; */
background: lightblue;
position: absolute;
bottom: 15%;
left: 5%;
width: 5%;
height: 5%;
}
#rodapecor02 {
/* background:#541324; */
background: lightblue;
position: absolute;
bottom: 15%;
right: 5%;
width: 5%;
height: 5%;
}
#rodapelinha {
background:#541324;
position: absolute;
bottom: 27%;
width: 100%;
height: 2%;
}
#whatimtryingtodo{
background: url('https://i.imgsafe.org/60c6fb0a1d.jpg');
background-repeat: no-repeat;
position:absolute;
top: 20px;
width: 100%;
height: 500px;
}
What I'm trying to do:
<div id="whatimtryingtodo">
</div>
<br><br><br><br><br><br><br><br>
What I got:
<div id="rodapelinha">
</div>
<footer id="rodape">
<div id="secretarias">SECRETARIAS:</div>
<div id="organizador">
<div id="centro">
<div class="menurodape">DESENVOLVIMENTO</div>
<div class="linha">|</div>
<div class="menurodape">SAÚDE</div>
<div class="linha">|</div>
<div class="menurodape">EDUCAÇÃO</div>
<div class="linha">|</div>
<div class="menurodape">SEGURANÇA</div>
<div class="linha">|</div>
<div class="menurodape">CULTURA</div>
</div>
</div>
<div id = "direita">
<div id="mapadosite">MAPA DO SITE</div>
<div id="rights">© 2016 UNA-SUS/UFCSPA - Todos os direitos reservados </div>
</div>
</footer>
<div id="rodapecor01">
</div>
<div id="rodapecor02">
</div>
【问题讨论】:
-
您可以将上面 sn-p 上的这个页脚(使用 flexbox)与我没有使用 flexbox(unasus.ufcspa.edu.br/cidadesvirtuais/SantaFe/1.0/layout.html)的这个页脚进行比较。我觉得用flexbox好多了我只是想知道如何解决我遇到的这些问题。