Shift the image closer to the top of the sidebar next to the header

I am seeking to adjust the positioning of my circular image in the sidebar so that it aligns with my name in the header. The contact and tech skills sections may also require some tweaking.

Although I have a grasp of the concepts of absolute and relative, I am struggling to implement a functional solution.

This is the current code I am working with:

<div style="position:relative; height:60px;">
<img src="profile_pic_circular.png"
   style="position:absolute; top:-10px; left:-30px; width:80px; height:80px; border:none;"
   alt="profile"
   title="profile photo" />
</div>

Access my resume with picture here.

Code:

@import url("https://fonts.googleapis.com/css?family=Montserrat|Playfair+Display&display=swap");

/* Set Montserrat as main text font */
body {
  font-family: "Montserrat", sans-serif;
  font-weight: 300;
  line-height: 1.3;
  color: #444;
}

/* Use Playfair Display font for headers */
h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
  color: #000;
}

/* Style superscripts for PDF export */
sup {
  font-size: 0.45rem;
  font-style: italic;
}

/* Prevent section breaking */
.blocks {
  break-inside: avoid;
}

* {
  /* Adjust sidebar margins */
  --pagedjs-margin-right: 0.2in;
  --pagedjs-margin-left: 0.2in;
}

/* Customize sizes */
:root {
  --sidebar-width: 12rem; /* Narrow sidebar width */
  --sidebar-background-color: #f7fbff; /* Blue sidebar */
  --sidebar-horizontal-padding: 0.01in; /* Decrease sidebar padding */
  --decorator-outer-dim: 10px; /* Increase position circles */
  --decorator-border: 2px solid #bdd7e7; /* Blue timeline */
}

.details .place {
  margin-top: 0.25rem;
}

.main-block:not(.concise) .details div {
  padding-top: 0.009rem;
}

.fa-laptop {
  margin-left: -3px;
}

#links li {
  list-style-type: decimal;
}

.aside li::before {
  display: none;
}

.aside ul {
  padding-left: 1rem;
}

.aside li::before {
  position: relative;
  margin-left: -4.25pt;
  content: "• ";
}

.aside {
  width: calc(var(--sidebar-width) + 9px);
  line-height: 1.2;
  font-size: 0.75rem;
}

.decorator::after {
  background-color: #08306b;
}

.aside li::before {
  content: auto;
}

.skill-bar {
  color: white;
  padding: 0.1rem 0.25rem;
  margin-top: 3px;
  position: relative;
  width: 100%;
}

.section.no-timeline h2::after {
  content: none;
}

.section.no-timeline h2 {
  padding-bottom: 1rem;
}

.info-card{
  width: 220px;    
  float: left;    
  padding: 0.5rem;
  margin: 0.5rem;
  box-shadow: 1px 1px 4px black;
}

Answer №1

Upon examination of the sidebar through the inspect tool by right-clicking, I noticed that there was a padding applied to the .aside element. To make your picture align properly with your headline, it is recommended to remove this padding.

padding: 0.6in var(--sidebar-horizontal-padding)

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

Having trouble with the <img> tag on CodeSandbox.io? Image not loading properly

I've been attempting to insert an image using the <img> tag on CodeSandbox.io. However, each time I try to do so, it fails to display and defaults to the alt tag (Shows Mountain). The goal is to load an image from the same folder as the file th ...

Drop draggable items on top of each other

I'm wondering if there's a way to drag jQuery elements into each other. To illustrate my question, I've duplicated this code (link) and made some style changes. Here is the updated version: Fiddle Link. In the current setup, you can drag e ...

Break up the content in table cells with a new line character

How can I get a string containing a new line character to wrap in a table cell? When I attempt to bind it, the text does not break at the new line character as expected. I have attached a screenshot for reference. In the console window, it displays correct ...

Struggling to use the innerHTML method to update a div within another div element?

<!DOCTYPE html> <html> <head> <title>Business Information Card</title> <script type="text/javascript"> window.onload = init; function init(){ var button = document.getElementById("populate ...

Having trouble with the scrollbar appearance after updating Chrome?

I've encountered an issue with my code after the latest Chrome update. Is there a way to implement cross-browser styling for scrollbars? // Looking for Scrollbar Styling Solution const scrollbarStyle = { scrollbarColor: `${themeLayers.scrollBar[0 ...

Modify the `div` content based on the selected items from the bootstrap dropdown menu

My navigation bar is built using Bootstrap and contains multiple drop-down items. Now I have another div with the class of col-md-3. Within this div, I would like to display the items of the dropdown menu when hovered over. Currently, hovering over a dro ...

How can you set an input field to be initially read-only and then allow editing upon clicking a button using Vue.js?

//I have two divs that need to be set as readonly initially. When an edit button is clicked, I want to remove the readonly attribute and make them editable. <div> <input type="text" placeholder="<a href="/cdn-cgi/l/email-protection ...

Viewport height-responsive image not functioning as expected in Firefox browser

Is there a way to set an image to the 100% height of the browser window, with a small padding at the bottom, and have it centered on the page? I created an example in codepen that works well in Chrome and Safari, but not in Firefox. In Firefox, the image ...

Display a <div> element styled using CSS3

Question: I am facing a challenge with CSS3 styling. I have one class and one div. The class is currently set to display:none, but I want it to show when the mouse hovers over it (display:block). I have attempted the following: .1:hover + div#2 { dis ...

What could be causing my canvas to not display my sprite?

Currently, I am in the process of learning JavaScript and experimenting with creating games to make the learning experience more enjoyable. However, I am facing an issue while using EaselJS and CreateJS to develop these games as a beginner. I need some as ...

Tips for accessing the names of subdirectories and files on a website

If we have the URL, is it possible to access the names of the files within the parent directory? Similar to how we can do in DOS by using the command "DIR" to view the list of files inside a folder. For example, if we have a URL like , I am curious to kno ...

Contrasting the utilization of percentage width in relative vs fixed contexts

I am facing an issue with the sizing of two div elements on my page, one with relative positioning and the other with fixed positioning. <div class="outer1"> </div> <div class="outer2"> </div> Here is the CSS: .outer1{ width: ...

Is there a way to modify the way a screen-reading tool pronounces a specific word in a sentence without causing interruptions in the middle of the sentence?

Imagine I have the following sentence written in HTML: <p>Please input your licence number</p> An issue arises when a screen-reader pronounces the word 'licence' as "liss-ens" instead of "lice-ens." To resolve this, I aim to provide ...

Explore the diverse webpages on my website

My website is built in html+css and the main content is contained within a div with the id "content" on index.html. There's a link on the menubar that leads to page2.php, but I want the content of page2.php to be displayed inside the <div "content" ...

Experiencing difficulty aligning the Material UI grid to float on the right side

I'm currently in the learning phase of material-ui and encountering an issue with floating the grid content to the right side. Despite trying alignItems="flex-start" justify="flex-end" direction="row" in the container grid, as well as using the css p ...

Navigating the battleground between native and HTML5 mobile applications

As an experienced iOS developer with knowledge in Windows Phone and Android, I have observed the increasing popularity of HTML5 web-apps over native apps. This shift towards HTML5 development frustrates me, as a strong argument can be made for native app d ...

Issues with internal linking in TYPO3 are causing anchor tags to malfunction

When creating an internal anchor, it is usually defined using <a name="anchorname">Introduction</a>. To link to this anchor, you would write something like <a href="#anchorname">Top</a>. In TYPO3, an anchor is a ...

Despite having the correct image URLs, the images are failing to display in the custom section of Shopify

Currently, I'm in the process of developing a unique Shopify section that showcases text alongside images. To enable users to upload images via the theme customizer, I have implemented the image_picker settings within the schema. The issue I am facing ...

Is there a way to access a large HTML file?

Currently, I have been utilizing a Python script to compare data and the resulting differences are saved in an HTML file. However, the size of the file has ballooned to 158 MB due to significant differences, making it impossible for me to open in any brows ...

Fade in and out on button press

There is a button with the following HTML code: <input type="submit" id="btnApply" name="btnApply" value="Apply"/> Upon clicking the button, a div should be displayed. <div> Thanks for applying </div> The display of the div should fade ...