How can you zoom in without disrupting the arrangement?

Initial state: https://i.sstatic.net/zZGXz.png

Final state: https://i.sstatic.net/JDeId.png

I am currently working on a 27' monitor, but my teacher will view the website on a 15-inch screen where the second image is what they'll see. How can I prevent overlapping and maintain proper positioning and size?

HTML:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Jared's Workshop | Homepage</title>
    <link rel="stylesheet" href="index.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <link rel="stylesheet" href="style.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="parallax.min.js"></script>
  </head>
  <header>
    <div class="number2">
    </div>
    <div class="navbar">
      <div class="navlinks">
        <ul>
          <li><a href="index.html">Home</a></li>
          <li><a href="gaming.html">Gaming</a></li>
          <li><a href="office.html">Office</a></li>
          <li><a href="contacts.html">Contacts</a></li>
          <li><a href="checkout.html">Checkout</a></li>
      </div>
    </div>

  </header>
  <body>
    <div class="container">


        <div id="info"></div>

        <div class="center">
          <div class="logo">
            <img src="logoreal2.png"/>
          </div>
            <div class="text">
                <h1>Contact Us</h1>
                <h4>- Socials -</h4>
                <div id="links">
                    <a id="facebook" href="https://www.facebook.com/jared.huynh.1">Facebook</a>
                    <a id="instagram" href="https://www.instagram.com/jarednhu/">Instagram</a>
                    <a id="twitter" href="https://twitter.com/JaredWorkshop">Twitter</a>
                </div>
                <h4>- Support -</h4>
                <div id="links2">
                    <a id="aa" href="https://mail.google.com/mail/u/0/#inbox?compose=jrjtXDzFhFXBrtwSfQzLJRrTmwBtfcnPVWKLhHzlGhTRbTKwsKbzRgrczFglKlXLmDLQtQCW" target="_blank">Email: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="efa58e9d8a8b9c98809d849c87809faf88828e8683c18c8082">[email protected]</a></a>
                    <a id="bb" href="#">Phone: 0426710063</a>
                    <a id="cc" href="https://www.google.com/maps/place/PLE+Computers+Wangara/@-31.7873489,115.8205448,17z/data=!3m1!4b1!4m5!3m4!1s0x2a32ad058339f89d:0xeb20a17d59f97d22!8m2!3d-31.7873535!4d115.8227335" target="_blank">Address: 1/46 Buckingham Dr, Wangara WA 6065</a>
                </div>
            </div>
        </div>
        <canvas></canvas>
        <script src="app.js"></script>


  </body>
</html>

CSS:

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap');

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    user-select: none;
}

body {
    background: #eee;
}

.text {
    font-family: 'Roboto', sans-serif;
    font-size: 50px;
    color: black;
    position: absolute;
}

a {
    display: block;
    text-decoration: none;
    color: black;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 70px;
    margin: 0;
}

h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 40px;
    margin: 0;
    margin-top:10px;
}

.hovered a {
    color: #ffffff66;
}

.hovered {
    color: #fff;
}

.center {

    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    box-shadow: inset 0 0 300px rgba(0, 0, 0, 0.3);
}

canvas {
    width: 100%;
    height: 100%;
}

#info {
    position: fixed;
    padding: 20px;
}

#facebook:hover {
    color: #FFFFFF;
}

#instagram:hover {
    color: #ff0066;
}

#twitter:hover {
    color: #fff;
}

.center .logo {
  text-align: center;
  position: absolute;
  padding-bottom: 0;
  margin-top: 30%;
  background-color: transparent;

}

.center .logo img {
  width: 1200px;
}
.text{
  transform: translate(0,-30%);
  background-color: transparent;

}

#facebook {
  font-size: 2rem;
}

#instagram {
  font-size: 2rem;
}

#twitter {
  font-size: 2rem;
}
#links a{
  display: inline-block;
  white-space: nowrap;
  padding: 20px;
  line-height: 2px;

}

#links2 a{
  line-height: 2px;
  white-space: nowrap;
  padding: 20px;

}

#aa{
  font-size: 2rem;
}

#bb{
  font-size: 2rem;
}

#cc{
  font-size: 2rem;
}

#aa:hover{
  color: #fe9500;
  transition: 0.5s;
}

#bb:hover{
  color: #fe9500;
  transition: 0.5s;
}

#cc:hover{
  color: #fe9500;
  transition: 0.5s;
}

Answer №1

The issue was resolved by eliminating the position:absolute; property in .center .logo{}, deleting the width: 1200px; declaration within .center .logo img{}, and relocating the entire code block:

      <div class="logo">
        <img src="logoreal2.png"/>
      </div>

I then moved this code inside

<div class="text">
, which shared the same container as the text below to adjust the logo position. Additionally, I applied a negative top margin to reposition it lower on the screen.

The final HTML output appeared like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Jared's Workshop | Homepage</title>
    <link rel="stylesheet" href="index.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <link rel="stylesheet" href="style.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="parallax.min.js"></script>
  </head>
  <header>
    <div class="number2">
    </div>
    <div class="navbar">
      <div class="navlinks">
        <ul>
          <li><a href="index.html">H o m e</a></li>
          <li><a href="gaming.html">G a m i n g</a></li>
          <li><a href="office.html">O f f i c e</a></li>
          <li><a href="contacts.html">C o n t a c t s</a></li>
          <li><a href="checkout.html">C h e c k o u t</a></li>
      </div>
    </div>

  </header>
  <body>
    <div class="container">


        <div id="info"></div>

        <div class="center">

            <div class="text">
              <div class="logo">
                <img src="logoreal2.png"/>
              </div>
                <h1>Contact Us</h1>
                <h4>- Socials -</h4>
                <div id="links">
                    <a id="facebook" href="https://www.facebook.com/jared.huynh.1">Facebook</a>
                    <a id="instagram" href="https://www.instagram.com/jarednhu/">Instagram</a>
                    <a id="twitter" href="https://twitter.com/JaredWorkshop">Twitter</a>
                </div>
                <h4>- Support -</h4>
                <div id="links2">
                    <a id="aa" href="https://mail.google.com/mail/u/0/#inbox?compose=jrjtXDzFhFXBrtwSfQzLJRrTmwBtfcnPVWKLhHzlGhTRbTKwsKbzRgrczFglKlXLmDLQtQCW" target="_blank">Email: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5efc4d7c0c1d6d2cad7ced6cdcad5e5c2c8c4ccc98bc6cac8">[email protected]</a></a>
                    <a id="bb" href="#">Phone: 0426710064</a>
                    <a id="cc" href="https://www.google.com/maps/place/PLE+Computers+Wangara/@-31.7873489,115.8205448,17z/data=!3m1!4b1!4m5!3m4!1s0x2a32ad058339f89d:0xeb20a17d59f97d22!8m2!3d-31.7873535!4d115.8227335" target="_blank">Address: 1/46 Buckingham Dr, Wangara WA 6065</a>
                </div>
            </div>
        </div>
        <canvas></canvas>
        <script src="app.js"></script>


  </body>
</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

CSS YUI compressor for efficient file size optimization

Seeking guidance on how to compress all CSS into a single line. Currently using the bwp-minify WordPress plugin, but looking to increase compression levels by modifying the YUICompressor.php file. Attempted adjusting the line-break parameter to 0 and 1000 ...

The footer is refusing to show up at the bottom of the page

Why is my footer floating in the middle of the page? It's driving me crazy. I really hope it's a quick fix. I've searched online and all the solutions point to having a fixed footer, but I don't want that because it looks bad on smaller ...

What is the best way to extract the value from an anchor element?

To retrieve the value from an input tag, we can use <id>.value like this: <input type="text" #solutionInput (keyup)="0"><br> <solutionDetail [solutionName]="solutionInput.value" > </solutionDetail> Here, 'solutionInput& ...

Using PHP to Transfer an Image File to a Text Document

Looking to enhance my PHP contact form by adding an image upload feature. I currently have a contact.html file that sends data to contact.php and logs everything in an errors.txt file. The goal is to allow users to upload images, store them in an "uploads ...

Creating an HTML report in Oracle SQL*Plus with alternating row colors

When using Oracle sqlplus, I can easily convert query output into an HTML report by setting "markup html on". This is a simple way to publish a database report online. However, I do miss one thing - alternating colors for every other row. This feature is ...

Toggle visibility of button based on React state

My current setup involves a button named download, which is a component integrated into my interface. The functionality associated with this button is implemented within a container. I intend for the button to remain hidden by default unless a specific co ...

Troubleshooting: PHP Integration Issue with HTML Document

I have a simple HTML file displaying text and including a PHP file with basic echos: The HTML code is in 'home.html' file: <html> <body> <h1>Welcome to my home page!</h1> <p>Some text.</p> <p>Some more ...

Issue with autocomplete feature in Safari on Gatsby input field

Can anyone help solve this issue I'm facing on my Gatsby site? I have an input field for user emails with autoComplete working perfectly on Chrome and Android, but not on Safari Desktop or mobile. Any suggestions? <input type="email" id ...

Website Not Loading Correctly

Why is my webpage not loading properly, even though it has the same HTML and CSS as my other functioning pages on the site? The page loads without the h1 element. If I comment out the span used for adding a transparent background image behind the whole we ...

The animated element in React is not running despite the animation class being added through addEventListener

When I add an animation class triggered by a scroll event listener, the progress bar animation only runs once on page load and does not run again when I scroll. Is there an issue with the code or is setState being used incorrectly? .body2 { background ...

How can we incorporate an algorithmic solution into an Angular brand carousel?

I am seeking to create a brand slider in Angular without relying on any external libraries or packages. The functionality I desire is as follows: 1 2 3(active) 4 5 2 3 4(active) 5 6 3 4 5(active) 6 7 4 5 6(active) 7 (empty) 5 6 7(active) (empty) (empt ...

Retrieve the HTML content of a Google Document and transmit it via GmailApp

I am struggling to send the content of a Google Document as HTML via Gmail, while trying to maintain the original formatting within the message. The current output is not accurate at all. When using Gmail, all formatting such as image wrapping, bold font ...

Tips for creating a dynamic text that adjusts to different screen sizes within a bootstrap button

When utilizing the w3.css and bootstrap libraries to add a link button, an issue arises when resizing the screen as the text inside the button does not respond accordingly. How can we ensure that the text fits within the button based on the screen resoluti ...

Issues with Button Clicking in Selenium Web Driver Java

Here is the HTML code below: <td class=" center-align" style="padding:10px 0 0 0;" colspan="3"> <span data-bind="visible: !editing()" style="display: none;"></span> <input id="btnSaveUserProfile" class="orange-but" type="button" data- ...

Switch up the image displayed when sharing content via buttons

Currently, I have implemented a custom sharing feature on my website using the code below: <div id="share_buttons"> <img src="images/facebook.png" onclick="popup('http://www.facebook.com/share.php?u=<?php echo $URL; ?>', &apos ...

Adjusting the amount of rows and columns in a fluid manner with CSS grid (updated)

After conducting my research, it seems that the most effective way to set the final value of a CSS grid is either by directly specifying it or by creating/manipulating the css :root value. A similar query was previously raised here, although the answers p ...

Issue: Unable to create the restangular module because: the variable '_' is not defined

Upon integrating Restangular into an existing website, I encountered a JavaScript error that stated: Failed to instantiate module restangular due to: '_' is undefined I'm unsure of what this means. Can anyone clarify why '_' is ...

Align the number of an Unordered List to the left

Exploring UN-ordered lists in HTML has led me to wonder if it's possible for dynamically generated ul tags to display like this: * Hello * Hi * Bi * Name * Ron * Mat * Cloth * Color * Red When I ...

Invalid file location of original image

I'm experiencing an issue where I am unable to capture the input image from my device. Instead, it keeps showing me a default image that I have set and provides a fake path for the input. Can someone help me solve this problem and provide some sugge ...

How can the AJAX request be adjusted to ensure that the dependent drop-down is hidden when the page initially loads?

My current form includes a dependent drop-down feature. Right now, both the main drop-down and the dependent one are displayed when the page loads. If a "Work Area" without a "Station" is selected, then the station drop-down disappears. What I want to acc ...