iT邦幫忙

0

visual studio code如何讓我的content往右移

  • 分享至 

  • xImage

https://ithelp.ithome.com.tw/upload/images/20230906/20162024Gv7w6dNZxJ.jpg

        }
        main{
            background-color: #e1b8f3;
            min-height: 150px;
            overflow:hidden;
        }
        .content{
            background-color: #de92ff;
            float:left;
            width: 56%;
            padding: 12px;
            margin: 2% 0;
        }
        figure{
            background-color: #f0d6fd;
            width: 40%;
            height: 150px;
            margin: 4%;
            float: left;
        }
        .gomore{
            background-color: darkblue;
            color: white;
            text-decoration: none;
            padding: 20px;
            display: block;
            clear: both;
            float: right;
            position: relative;
        }
        .gomore p{
            background-color: black;
            color: white;
            padding: 10px;
            position: absolute;
            right: 0;
            top: 0;
            width: 250px;
            transform: translateY(calc(-100%-15px));
            display: none;
        }
        .gomore p::after{
            content: '';
            display: block;
            width: 0;
            height: 0;
            border: 15px solid transparent;
            border-top-color: black;
            position: absolute;
            right: 0;
            bottom: 0;
            transform: translate(-30px,28px);
        }
        .gomore:hover p{
            display: block;
        }
        footer{
            background-color: #d5f3b8;
            text-align: center;
            padding: 1em;
        }
        img{
            background-color: #fff;
            width: 150px;
            padding: 20px;
            margin: 20px;
            /* display: inline-block; */
            /* display: inline; */
  
        }
       
        </style>
</head>
<body>
    <header>
        <div class="Logo">Logo</div>
        <nav>
            <a href="">回首頁</a>
            <a href="">button1</a>
            <a href="">button2</a>
            <a href="">button3</a>
            <a href="">button4</a>
            <a href="">button5</a>
        </nav>
    </header>
    <main>
        <div>
            <img src="./images/01.jpg">
       </div>
        <div class="content">
            <h1>BAS建築自動化系統</h1>
            <figure>介紹內容 Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit ut fugiat neque. Dolorum voluptatum eum voluptas facere doloribus aliquam, illum officia aspernatur, ipsam, sit ducimus molestiae sunt dignissimos. Necessitatibus, nihil.</figure>
            <figure>手冊下載</figure>
        </div>
    </main>
    
    <footer>
        <p>Copyright © 2023 ITsESG</p>
    </footer>
</body>
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
janlin002
iT邦好手 1 級 ‧ 2023-09-06 12:30:07
最佳解答
.content{
    background-color: #de92ff;
    float:left;
    width: 56%;
    padding: 12px;
    margin: 2% 自定義 2% 0;
}

自定義 你自己決定要推多少

可參考: https://www.w3schools.com/css/css_margin.asp

謝謝

我要發表回答

立即登入回答