Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· openaiHugging Face Suzhen/CodeChat

используя css, html напиши мне блок , который мог бы содержать текст и картинки, который…

  1. User

    используя css, html напиши мне блок , который мог бы содержать текст и картинки, который выглядел красиво

  2. Assistant

    Я предлагаю создать блок с простой сеткой, содержащей текст и картинку. Воспользуйтесь следующим кодом HTML и CSS:

    HTML:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="styles.css">
        <title>Beautiful Block</title>
    </head>
    <body>
        <div class="container">
            <img src="your-image-url.jpg" alt="image" class="image">
            
            <div class="content">
                <h2>Заголовок</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec massa ut arcu lacinia vestibulum. Vestibulum nec nibh id risus interdum laoreet.</p>
            </div>
        </div>
    </body>
    </html>
    

    CSS (styles.css):

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    body {
        font-family: Arial, sans-serif;
        line-height: 1.6;
        background: #f4f4f4;
    }
    
    .container {
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 1000px;
        margin: 30px auto;
        padding: 20px;
        background: #fff;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        border-radius: 10px;
    }
    
    .image {
        width: 40%;
        margin-right: 20px;
        border-radius: 5px;
    }
    
    .content h2 {
        margin-bottom: 10px;
    }
    
    .content p {
        font-size: 16px;
    }
    

    Примечания:

    1. Замените your-image-url.jpg на ссылку на ваше изображение.
    2. Вы можете настроить стили по своему усмотрению, чтобы изменить внешний вид блока.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.