작성
·
147
0
강의 내용중에 list 파일중에
.container a {
width: 45%
max-width: 250px;
}
를 넣어도 a 태그가 적용이 안되는거 같은데...
( img size의 max-width가 안먹히는거 같아요!)
이런경우는 어느 부분을 확인해야할까요? ㅠㅠ
(img 의 width를 수정하면 줄어들긴합니다..)
아래는 전체 소스입니다...
<style>
.container {
padding: 0;
margin: 0, auto;
}
.container a {
width: 45%
max-width: 250px;
}
.container div {
display: flex;
justify-content: center;
align-items: center;
border-radius: 1rem;
}
.container img {
width:100%;
border-radius:1rem;
}
</style>
{% if article_list %}
<div class="container">
{% for article in article_list %}
<a href="{% url 'articleapp:detail' pk=article.pk %}">
{% include 'snippets/card.html' with article=article %}
</a>
{% endfor %}
</div>
<script src="{% static 'js/magicgrid.js' %}"> </script>
{% else %}
답변