Challenges with Image Placement and Alignment

Having trouble with the sizing of my image in the skill portion of my website. The clouds and mountains look fine, but for some reason, the image isn't the same size.

Additionally, the text "full stack developer" is not centered under my name anymore.

I've tried adjusting margins, padding, text alignment, and centering without success.

I can't seem to figure out where I went wrong, and unfortunately, I didn't version control properly to revert back to a working state.

.top-container {
  background-color: #ffcb74;
}

body {
  margin: auto;
  margin-top: 0;
  text-align: center;
  background-color: white;
}

img {
  border-radius: 50%;
  height: auto;
}

h1 {
  margin: 0;
  position: static;
  font-family: 'Comfortaa', cursive;
  padding-top: 10%;
  color: #66BFBF;
  line-height: 2;
}

h2 {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.5rem;
  color: #66BFBF;
  font-weight: normal;
  text-align: left;
  margin-left: 25%;
}

h3 {
  color: #11999E;
}

a {
  color: #11999E;
}

.get-in-touch {
  text-align: left;
  margin: auto;
}

.fsd {
  margin-right: 50%;
}


.contact-me {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.bottom-container {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.footer-link {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}


.skill-row {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.hello-part {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.bottom-cloud {
  position: absolute;
}

.top-cloud {
  position: absolute;
  right: 305px;
}

.my-skills {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.webdev-Image {
  width: 25%;
}
<div class="top-container">
    <img class="top-cloud" src="cloud.png" alt="clouds-img">
    <h1>I'm Malcolm Henry</h1>
    <h2 class="fsd">a full stack developer</h2>
    <img class="bottom-cloud" src="cloud.png" alt="clouds-img">
    <img src="mountain.png" alt="mountain-img">
  </div>

  <br>

  <div class="middle-container">
    <div class="profile">
      <img class=""src="" alt="">
      <h2>Hello.</h2>
      <p class="hello-part">Lorem ipsum dolor sit amet, vitae volutpat, dui conubia, dolor urna. Non auctor, montes nulla distinctio.</p>
    </div>

    <div class="skills">
      <h2>My Skills.</h2>
      <div class="my-skills">
        <img class="coding-Image" src="Skills.png" alt="Skills Image">
        <h3>Lorem & Ipsum</h3>
        <p>Lorem ipsum dolor sit amet, quis in duis, iaculis id felis. Consectetuer vestibulum, nunc urna lectus, erat ligula. Hendrerit nam, lectus ante, ut lorem eros.</p>
      </div>
      <div class="skill-row">
        <img class="webdev-Image" src="web dev.jpeg" alt="2020 Web Dev Image">
        <h3>Lorem Ipsum Dolor</h3>
        <p>Lorem ipsum dolor sit amet, mauris sed consectetuer. Etiam et eu, bibendum interdum, lacus quis mauris. Curabitur wisi, quisque vel eu, rutrum nam.</p>
      </div>
    </div>
    <br>
    <div class="contact-me">
      <h2 class="get-in-touch">Get In Touch</h2>
      <h3>Lorem ipsum dolor sit amet, non elit.</h3>
      <p>Lorem ipsum dolor sit amet, in quis, aenean amet. Phasellus sodales, tellus donec dui, ornare erat.</p>
      <a class="btn" href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="492728242c092c24282025672a2624">[email protected]</a>">CONTACT ME</a>
    </div>
  </div>


  <div class="bottom-container">
    <a class="footer-link" href="https://www.linkedin.com/in/malcolm-henry-099305168/">LinkedIn</a>
    <a class="footer-link" href="https://twitter.com/">Twitter</a>
    <p>© 2020 Malcolm Henry.</p>
  </div>

Answer №1

"front end developer" is not aligned properly because you have set a margin-left of 25% in h2 and a margin-right of 50% in fnd.

The sizes of the images in skills vary because one has a class of webdev-Image and the other has a class of coding-Image, which has not been defined.

To fix these issues, the corrected code is provided below:

.top-container {
  background-color: #ffcb74;
}

body {
  margin: auto;
  margin-top: 0;
  text-align: center;
  background-color: white;
}

img {
  border-radius: 50%;
  height: auto;
}

h1 {
  margin: 0;
  position: static;
  font-family: 'Comfortaa', cursive;
  padding-top: 10%;
  color: #66BFBF;
  line-height: 2;
}

h2 {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.5rem;
  color: #66BFBF;
  font-weight: normal;
  text-align: left;
  margin-left: 25%;
}

h3 {
  color: #11999E;
}

a {
  color: #11999E;
}

.get-in-touch {
  text-align: left;
  margin: auto;
}

.fnd {
  margin-left: 0%;
  width: 100%;
  text-align: center;
}


.contact-me {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.bottom-container {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.footer-link {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}


.skill-row {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.hello-part {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.bottom-cloud {
  position: absolute;
}

.top-cloud {
  position: absolute;
  right: 305px;
}

.my-skills {
  width: 50%;
  margin: auto;
  text-align: left;
  line-height: 2;
}

.webdev-Image {
  width: 25%;
}
<div class="top-container">
  <img class="top-cloud" src="https://picsum.photos/100/100" alt="clouds-img">
  <h1>I'm Malcolm Henry</h1>
  <h2 class="fnd">a front end developer</h2>
  <img class="bottom-cloud" src="https://picsum.photos/100/100" alt="clouds-img">
  <img src="https://picsum.photos/100/100" alt="mountain-img">
</div>

<br>

<div class="middle-container">
  <div class="profile">
    <img class="" src="" alt="">
    <h2>Hello.</h2>
    <p class="hello-part">Lorem ipsum dolor sit amet, vitae volutpat, dui conubia, dolor urna. Non auctor, montes nulla distinctio.</p>
  </div>

  <div class="skills">
    <h2>My Skills.</h2>
    <div class="my-skills">
      <img class="webdev-Image" src="https://picsum.photos/100/100" alt="Skills Image">
      <h3>Lorem & Ipsum</h3>
      <p>Lorem ipsum dolor sit amet, quis in duis, iaculis id felis. Consectetuer vestibulum, nunc urna lectus, erat ligula. Hendrerit nam, lectus ante, ut lorem eros.</p>
    </div>
    <div class="skill-row">
      <img class="webdev-Image" src="https://picsum.photos/100/100" alt="2020 Web Dev Image">
      <h3>Lorem Ipsum Dolor</h3>
      <p>Lorem ipsum dolor sit amet, mauris sed consectetuer. Etiam et eu, bibendum interdum, lacus quis mauris. Curabitur wisi, quisque vel eu, rutrum nam.</p>
    </div>
  </div>
  <br>
  <div class="contact-me">
    <h2 class="get-in-touch">Get In Touch</h2>
    <h3>Lorem ipsum dolor sit amet, non elit.</h3>
    <p>Lorem ipsum dolor sit amet, in quis, aenean amet. Phasellus sodales, tellus donec dui, ornare erat.</p>
    <a class="btn" href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1779767a7257727a767e7b3974787a">[email protected]</a>">CONTACT ME</a>
  </div>
</div>


<div class="bottom-container">
  <a class="footer-link" href="https://www.linkedin.com/in/malcolm-henry-099305168/">LinkedIn</a>
  <a class="footer-link" href="https://twitter.com/">Twitter</a>
  <p>© 2020 Malcolm Henry.</p>
</div>

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

Ever since implementing a new section class, the CSS first-of-type selector has ceased to function

After referencing a previous response, I utilized first-of-type to specifically target the initial menuSection with this code snippet... .menuSection:first-of-type { background: red; } <div id="container"> <section class="menuSection"> ...

using angularjs to dynamically apply css styles

Below is the input I have: The HTML code is shown below: <input type="number" ng-class="{negative: amount < 0}" ng-model="amount"/> This is the corresponding CSS code: .negative { color: red; } If the amount is positive, no specif ...

Using Javascript to dynamically enable or disable an input field depending on the choice made in another field

I attempted to implement the solution provided in this answer for my code: How do I disable input field when certain select list value is picked but unfortunately, it is not working as expected. The scenario involves an HTML select field with the ID &apos ...

Error Message: The function "menu" is not a valid function

I've encountered an issue with a function not being called properly. The error message states "TypeError: menu is not a function." I attempted to troubleshoot by moving the function before the HTML that calls it, but unfortunately, this did not resolv ...

Send the user back to the homepage without the need to refresh the page

When the user clicks "Okay" in my window.prompt, the code below opens a new tab. Is there a way to direct the user to the home page without opening a new tab? if (window.confirm("Do you really want to leave?")) { window.open("./Tutoria ...

centered table within a container with vertical alignment

I'm having trouble centering a table vertically in a div. I've tried using vertical-align but it's not working for me. Can anyone suggest a solution to place it at the top of the div? <div class="col-12 d-flex"> <div c ...

Ways to turn off the dragging animation for cdkDrag?

I am facing an issue with cdkDrag where a small preview of the item being dragged shows up. I want to disable this feature and remove any CSS classes related to the dragging state. Can anyone guide me on how to achieve this? https://i.sstatic.net/nYU07.pn ...

Why won't applying a binding style affect the appearance of my Vue component?

const EventLevelBoard = { name: "EventLevel", data: { levelStyle: { display: "block" }, levelStyleinner: [ { display: "block" }, { display: "block" }, { display: "block&qu ...

The attribute selector is malfunctioning

Currently, I am attempting to target img tags based on the alt attribute in order to correctly load a background-image on mobile devices. The issue I am encountering is that regardless of the combination of attribute selectors I use, it does not seem to w ...

Looking for a JavaScript snippet to insert the word "Search" into an empty DIV element with the specified id attribute

I am trying to insert the word "Search" into an empty input field with the id "ReportQuery" using JavaScript. Unfortunately, I do not have access to the HTML code directly. How can I achieve this task through coding? Below is the snippet of code that nee ...

In CSS3, utilize the calc() function to vertically center elements using viewport height (vh) and viewport

One of the most common cases involves using vh for setting the height of a div, and using vm for adjusting font size. Using CSS3 div.outer { height: 20vh; } div.inner { font-size: 3vw; height: auto; } div.inner2 { font-size: 2vw; } HTML - Scenario 1 <d ...

The Issue with jQuery Masked Input Functionality

Currently, I am utilizing the jQuery masked input plugin version 1.2.2 created by DigitalBush. Upon applying masks like: $(".phone").mask("(999)-999-9999"); $(".zip").mask("99999?-9999"); to input boxes, I have noticed some peculiar behavior. Essential ...

Switch button - reveal/conceal details

I am looking for assistance in toggling the visibility of information when clicking on an arrow icon. I have attempted to use JavaScript, but it was unsuccessful. My goal is to hide the information below by clicking on the downward-facing arrow image , an ...

Navigation bar failing to show all content on Safari web browser

When navigating to this website, http://www.togethermutualinsurance.co.uk, using any browser except for Safari on Windows, the menu displays correctly. However, in Safari, the title of the menus and submenus with images does not display properly. Despite ...

Eliminate embellishments upon hovering over hyperlinks

Is there a method to prevent my links from becoming underlined or changing color when hovered over? ...

What methods can you use to locate the CSS selector within HTML that meets certain criteria?

Is it possible to parse a given link and find CSS selectors with attributes that partially or completely match a specific keyword? For example, if the keyword is "print," I want to identify all CSS selectors in the link containing "print" in their name, id ...

Utilizing a StyledComponents theme within a Component

When creating a style called Link, the theme is contained inside of this.props. How can the theme be extracted from props and passed into the Link styled component? Error: ReferenceError - theme is not defined import React from 'react'; impo ...

Is there a method available that would allow me to display my HTML code within a frame using Selenium WebDriver and Java?

Currently, I am in the process of automating an Application that includes several embedded iframes. I am wondering if there is a method to view my HTML source code within these frames. ...

What is the method for integrating an element into a different flow using the position property?

How can I solve the following issue: I am working with a carousel markup that has the same HTML structure as shown below. <div> // Contains the carousel slide <div> <ul> <li><img src={....} /></li> <li ...

What is the best way to align a div of variable size in a container of variable size using CSS?

My website features a 3-level structure that consists of a "workingArea" and an "imageContainer" within it, containing an image. <div class="workingArea"> <div class="imageContainer"> <img class="theImage" /> </div> </div> ...