很抱歉这个菜鸟和愚蠢的问题,但我对 css 知之甚少,我不知道如何设计我的网站。这是我的代码:
HTML(树枝):
<div class="wrap">
<div>
<img class="birthday" src="http://www.clker.com/cliparts/1/d/a/6/11970917161615154558carlitos_Balloons.svg.med.png">
<div class="try">
This friends have brithday today:
{% for bd in birthdays %}
<p>
<a href="{{ path('friend_id', {'id': bd.id}) }}">{{ bd.name }}</a>
<span class="years">
({{ bd.years }} years)
</span>
</p>
{% endfor %}
</div>
</div>
</div>
CSS:
body {
background-color: #FFFFF1;
text-align: center;
font-size: 17px;
font-family: Tahoma, Geneva, sans-serif;
}
p {
margin: 10px;
}
a {
text-decoration: none;
color: #6a9211;
}
a:hover {
text-decoration: underline;
}
.wrap {
width: 700px;
margin: auto;
}
.birthday {
width: 49px;
height: 80px;
float: left;
margin-left: 150px;
display: block;
}
.try {
display: block;
margin-right: 150px;
margin-bottom: 50px;
}
.years {
font-size: 12px;
}
这就是我得到的。我要解决的问题是Maria
并Peter
显示在Anna
and下John
,所有这些都 4 在标签下居中This friends have birthday today:
。我知道这是因为图像,但我不知道如何使它看起来很好。:(
请帮忙!提前致谢!