Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS로 버튼 너비 설정

<시간/>

버튼 너비를 설정하려면 CSS 너비 속성을 사용하세요.

예시

다음 코드를 실행하여 버튼의 너비를 설정할 수 있습니다 -

<!DOCTYPE html>
<html>
   <head>
      <style>
         .btn {
            background-color: yellow;
            color: black;
            width: 120px;
            text-align: center;
            font-size: 15px;
            padding: 20px;
            border-radius: 15px;
            border: 3px dashed blue;
         }
      </style>
   </head>
   <body>
      <h2>Result</h2>
      <p>Click below for result:</p>
      <button class = "btn">Result</button>
   </body>
</html>