강의

멘토링

커뮤니티

Inflearn Community Q&A

jini0513's profile image
jini0513

asked

Learn CSS Flex and Grid Properly

Flex UI #1 - Menu

안녕하세요 질문이 있습니다

Written on

·

359

0

안녕하세요 텍스트가 볼드, 가운데 정렬, 눌렀을때 컬러가 하얀색이 되지 않습니다. 이유를 알수있을까요? ㅠㅠ

flexHTML/CSS

Answer 5

0

jini0513님의 프로필 이미지
jini0513
Questioner

앗 그렇군요 감사합니다 ㅠㅠ

0

studiomeal님의 프로필 이미지
studiomeal
Instructor

home, about같은 텍스트들을 <a>태그 안에 넣어주세요^^
아래와 같은 형식으로 하시면 됩니다.

<li class="menu-item"><a href="#" class="menu-link">home</a></li>

0

jini0513님의 프로필 이미지
jini0513
Questioner

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>css flex!!</title>

<link rel="stylesheet" href="플렉스 메뉴.css">

<style>

     ul{list-style:none;}

    ul{padding: 0; list-style: none;}

    </style>

    

</head>

<body>

 <ul class="menu">

     <li class="menu-item"><a href="#" class="menu-link"></a>home</li>

     <li class="menu-item"><a href="#" class="menu-link"></a>about</li>

     <li class="menu-item"><a href="#" class="menu-link"></a>product</li>

     <li class="menu-item"><a href="#" class="menu-link"></a>contact</li>

 </ul>

</body>

</html>

0

jini0513님의 프로필 이미지
jini0513
Questioner

.menu{display: flex;}

.menu-item{

    width: 25%;

    background: gold;}

.menu-item:hover{

    width: 35%;

    background: crimson}

.menu-link{display: block;

            padding: 1em;

            font-size:1.2rem;

            font-weight: bold;

            color:#555;

            text-decoration: none;

            text-align: center;}

.menu-link:hover{color: white;}

0

studiomeal님의 프로필 이미지
studiomeal
Instructor

소스를 올려봐주시겠어요? 구조에 따라 CSS 우선순위가 바뀌었을 가능성이 있어서요~

jini0513's profile image
jini0513

asked

Ask a question