Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

<DIV CLASS="container"> <DIV CLASS="copyright">© nikhil.com • 2024</DIV> <IMG…

  1. User
  2. Assistant

    To achieve a vertical alignment of the copyright text, the logo, and the "Nikhil LOLOLOL" text while ensuring that the logo has a specified height of 100px and the copyright and "Nikhil LOLOLOL" texts match the width of the logo, you can use the following HTML and CSS code.

    Here’s how you can implement it:

    HTML

    <DIV CLASS="container"> 
        <IMG SRC="johnstonhighschool.png" ALT="Johnston High School Logo" CLASS="logo"> 
        <B CLASS="blurredText">Nikhil LOLOLOL</B> 
        <DIV CLASS="copyright">© nikhil.com • 2024</DIV>
    </DIV>
    

    CSS

    .container {
        display: flex;
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center items horizontally */
        text-align: center; /* Center text */
    }
    
    .logo {
        height: 100px; /* Set logo height to 100px */
        width: auto; /* Keep the width proportional */
    }
    
    .blurredText,
    .copyright {
        width: 100%; /* Match width with the logo */
        max-width: 100px; /* Cap the maximum width */
        display: inline-block; /* Make sure the width applies correctly */
    }
    

    Explanation:

    1. Container: The container is set to a flexbox with a vertical direction (flex-direction: column). This will stack the items (logo, text, copyright) vertically.
    2. Logo: The logo's height is fixed to 100px, and the width is set to auto to maintain the aspect ratio.
    3. Text Width: The "Nikhil LOLOLOL" and copyright text are set to take up the full width available but limited by the width of the logo, which is capped at 100px. The texts use display: inline-block to allow their widths to be influenced by the container's width.

    With this setup, the logo will maintain its size, and the text will align vertically beneath it with the desired width.