강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

장동현님의 프로필 이미지
장동현

작성한 질문수

입문자를 위한 CSS 기초 강의

수업 마무리

font-weight가 적용이 안 되는데 어떻게 하나요?

작성

·

1.1K

0

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>회사 웹 페이지 만들기</title>
    <style>
        body{
            font-weight: 30px;
        }
        img{
            display: flex;
            float: left;
            width: 130px;
            height: 30px;
            margin: 10px 0px 0px 8px;
        }

        img:hover{
            cursor: pointer;
        }

        img, .menu_bar{
            margin-right: 50px;

        }


        .menu_bar{
            width: 100%;
            height: 70px;
            border: 2px solid black;
            text-align: center;
            display: flex;
            float: left;
        }

        input{
            width: 110px;
            height: 45px;
            margin-right: 10px;
            margin-top: 12px;
            background-color: white;
            font-family: "돋움";
            font-size: 15px;
            border: none;
            border-radius: 5px;
            
        }

        input:hover{
            background-color: #f8f9fa;
            cursor: pointer;
        }


        #event, #freeStart{
            width: 170px;
        }

        #freeStart{
            color: white;
            background-color: #ff6464;
            
        }

        #freeStart:hover{
            background-color: #DB4455;
        }

        #login{
            margin-left: 100px;

        }

        div > #seeMore{
            width: 20px;
            height: 20px;
            padding: 12px;
            
        }

        #seeMore:hover{
            background-color: #f8f9fa;
        }
    </style>
</head>
<body>

    <div class="menu_bar">
        <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/NHN_COMMERCE_CI.png/1600px-NHN_COMMERCE_CI.png" alt="회사로고">
        
        
            <input type="button" name="쇼핑물" id="shop" value="쇼핑몰">
            <input type="button" name="스토어" id="store" value="스토어">
            <input type="button" name="마케팅" id="marketing" value="마케팅">
            <input type="button" name="고객지원" id="customer" value="고객지원">
            <input type="button" name="이벤트" id="event" value="혜택 ● 이벤트">
            <input type="button" name="엔터프라이즈" id="enterprise" value="엔터프라이즈">
            <input type="button" name="이전센터" id="center" value="이전센터">


            <input type="button" name="로그인" id="login" value="로그인">
            <input type="button" name="무료로 시작하기" id="freeStart" value="무료로 시작하기">


            <img src="/image/메뉴바.png" id="seeMore" alt="">
    </div>
    



</body>
</html>

답변 1

1

안녕하세요, 인프런 AI 인턴입니다.

님의 CSS 코드에서 font-weight 속성이 제대로 적용되지 않는 문제는 font-weight 속성에 잘못된 값이 할당되었기 때문입니다. font-weight 속성은 글꼴의 두께를 지정하는 속성으로, 픽셀(px) 단위가 아니라 normal, bold, bolder, lighter, 또는 100부터 900까지의 숫자를 사용하여 글꼴 두께를 지정합니다.

올바른 사용 예는 다음과 같습니다:

body{
    font-weight: bold;
}

또는 숫자값을 사용하여 지정할 수 있습니다:

body{
    font-weight: 400; /* Normal weight */
}

30px 대신 font-weight의 올바른 값을 사용하여 수정해 보시길 바랍니다.

장동현님의 프로필 이미지
장동현

작성한 질문수

질문하기