relocate the words to a designated location

Issue- How can we relocate the line below "Hi I'm a developer that loves clean & elegant code"

From this location

https://i.sstatic.net/UgrC9.png

to this location

https://i.sstatic.net/6yEMO.png


HTML snippet (sequencing must remain intact EX.cannot simply move "Hi, i'm a developer..." just above the "A little bit about me" line)

<body>
   <header>
     <div class="full-width">
       <div class="half-width">
         <h1>Jubilee Austin</h1>
       </div>
       <div class="half-width">
         <h2><span>Hi,</span> i'm a developer that loves clean &amp; elegant code.
         </h2>
         <nav>
           <ul>
             <li><a href="#about">About</a></li>
             <li><a href="#work">Work</a></li>
             <li><a href="#contact">Contact</a></li>
             </ul>
         </nav>
       </div>
     </div>
   </header>
   <main>
     <section id="about">
       <div class="full-width">
         <h2>A little bit about me</h2>
         <div class="half-width">
           <p> i've made my home base in Providence, Rhode Island with my small growing family. My journey into tech started with a degree in journalism.As I started sharing my writing online, I was fascinated with how easily I could get my voice out there. I was hooked and wanted to learn how to build my own site to fit my own specific needs.</p>
         </div>
           <div class="half-width">
             <p>That curiosity then opened a door that could never be shut. When I learned how to build my first website, I realized I found something that gave me the freedom &amp; versatility I was looking for in my work. Now I've made a full switch to front-end development, where I can use my organization skills and eye for detail to write clean, elegant code.</p>
           </div>
           </div>
     </section>

All CSS styles

/****Base syles***/
body {
  font-family: 'Source Sans Pro', sans-serif;
}
#about, #work, #contact {
  height: 600px;
  border: solid red;
}
/***Grid***/
.full-width{
  width:1200px;
  margin: 0 auto;
}
.half-width{
  width:600px;
  float:left;
}
.third-width{
  width:400px:
  float:left;
}
/***About specific***/
#about .full-width{
  padding:80px 0;
}
#about h2{
  font-family: 'Lora', serif;
  font-size:36px;
  color:#262a2b;
}

#about p{
  font-size:21px;
  color:#7f7f7f;
  line-height:42px;
  padding-right:50px;
}

Answer №1

Update:

I have made adjustments to the example below by implementing a pure CSS solution tailored to your use case while maintaining the document structure integrity. Please find the relevant excerpt below:

@media (max-width: 1234px) {
  .hi {
    left: 10px;
  }
}

@media (min-width: 1235px) {
  .hi {
    left: calc(50% - 600px);
  }
}

.hi {
  position: absolute;
  top: 60px;
}

Points to Note:

  • The usage of position: absolute serves to shift the element out of the normal document flow to its designated location.
  • @media queries are leveraged to align with your specified width settings.
  • The seemingly arbitrary numbers 1234px/1235px are derived from when the width surpasses that defined in the .full-width class. It combines the specified full width value of 1200px with additional factors such as 20px from the browser scroll bar and 14px/15px from the default margin applied to the document body.

Execute the code snippet provided below to witness how it effectively caters to your specific requirements:

/****Base syles***/
body {
  font-family: 'Source Sans Pro', sans-serif;
}
#about, #work, #contact {
  height: 600px;
  border: solid red;
}
/***Grid***/
.full-width{
  width:1200px;
  margin: 0 auto;
}
.half-width{
  width:600px;
  float:left;
}
.third-width{
  width:400px;
  float:left;
}

@media (max-width: 1234px) {
  .hi {
    left: 10px;
  }
}

@media (min-width: 1235px) {
  .hi {
    left: calc(50% - 600px);
  }
}

.hi {
  position: absolute;
  top: 60px;
}

/***About specific***/
#about .full-width{
  padding:80px 0;
}
#about h2{
  font-family: 'Lora', serif;
  font-size:36px;
  color:#262a2b;
}

#about p{
  font-size:21px;
  color:#7f7f7f;
  line-height:42px;
  padding-right:50px;
}
<body>
   <header>
     <div class="full-width">
       <div class="half-width">
         <h1>Jubilee Austin</h1>
       </div>
       <div class="half-width">
         <h2 class='hi'><span>Hi,</span> i'm a developer that loves clean &amp; elegant code.</h2>
         <nav>
           <ul>
             <li><a href="#about">About</a></li>
             <li><a href="#work">Work</a></li>
             <li><a href="#contact">Contact</a></li>
             </ul>
         </nav>
       </div>
     </div>
   </header>
   <main>
     <section id="about">
       <div class="full-width">
         
         
         <h2>A little bit about me</h2>
         <div class="half-width">
           <p> i've made my home base in Providence, Rhode Island with my small growing family. My journey into tech started with a degree in journalism.As I started sharing my writing online, I was fascinated with how easily I could get my voice out there. I was hooked and wanted to learn how to build my own site to fit my own specific needs.</p>
         </div>
           <div class="half-width">
             <p>That curiosity then opened a door that could never be shut. When I learned how to build my first website, I realized I found something that gave me the freedom &amp; versatility I was looking for in my work. Now I've made a full switch to front-end development, where I can use my organization skills and eye for detail to write clean, elegant code.</p>
           </div>
           </div>
     </section>

Prior Solution: You have the option of relocating the line

<h2><span>Hi,</span> i'm a developer that loves clean & elegant code.</h2>
just before the segment featuring
<h2>A little bit about me</h2>
.

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

How was the background design accomplished on this particular website using CSS?

I've noticed that the background on this website scrolls and changes at various points. It transitions from blue to green with clouds moving. I'm curious about what term is used to describe this type of background effect (I don't think it&ap ...

Web font display problem: browsers appear to be experiencing difficulty with determining the correct size and placement

I recently encountered a unique issue while using two different webfonts in one of my projects. One font seems to be causing a rendering problem that I have never experienced before, while the other font displays correctly. It appears that the browser is ...

Eliminate the tag while retaining the contents using jQuery or Javascript

Feeling a bit tired tonight and struggling to figure out this task. I have a similar problem like the one below where I need to remove HTML tags but keep their contents: <a href="#">some content</a> and more <a href="#"> and more content ...

What are some effective ways to transition a logo into a hamburger icon when hovered over?

In my React project, I am looking to enhance the user experience by adding an interactive element to the collapsed sidebar menu. My goal is to have the logo at the top of the sidebar transform into a basic hamburger menu when hovered over, and then revert ...

Python web scraping involves the process of extracting information from websites using code. One common task is extracting

I am working on a web scraping project to extract the first link under the article tag. Currently, I have the following code snippet: for link in soup.find("section", {"id": "grid"}).findAll("a", href=re.compile("/recipe/[0-9]*/.*/")): if 'href&a ...

Tips for utilizing the .ready() function within the .load() method

With the implementation of a jQuery script on my website, I have created a dynamic platform where the main content changes as you navigate without fully reloading the page. However, there is an issue with the .load() function in jQuery that interferes with ...

What is the method for including a text field within an SVG?

I am new to working with SVG files and I have a question about placing a text field over an SVG file. Is it possible to add a text field within the SVG file itself? Currently, I am using the SVG file as an <img> in my HTML code. Can anyone guide me o ...

Validation of HTML5 forms using jQuery

I am in need of a jQuery-based validation library that will kick in when the browser does not support HTML5 for specific attributes like 'required' or 'placeholder'. After looking around, I have come across several libraries but they ar ...

Unique twist on the Bootstrap grid: perfectly centered

I'd like to design a 12-column Bootstrap grid with specific colors. The header should be light blue, the body in green, and the footer orange against a grey background. I want the grid to be centered on the screen with horizontal light blue stripes m ...

A guide on applying numeric values to set RGB colors in CSS

I'm new to HTML/CSS and I've noticed that there are different ways to set color codes in CSS, such as using names like yellow or hex codes like #ffff00. I've also learned that each color has a numeric equivalent, for example, yellow is repre ...

What could be causing my page's wrapper to shrink upon logging in?

After logging out, the background of my page wrapper expands to cover 100% of the page. However, once you log back in, it shrinks and adjusts to the width of the member bar... TO TEST USER ACCOUNT BELOW: USERNAME: TEST PASSWORD: TEST123 HTML FOR LOGGED ...

Dual scrollbars and a collapsing toolbar

Currently immersed in the development of a photo gallery using AngularJS and Angular Material (expand to fullscreen to observe the issue). var app = angular.module('app', ['ngMaterial']); app.controller('TitleController', f ...

Only one submenu can be opened at a time & click to close

I am encountering an issue with my list and submenus. When I click on List 1, submenu 1 opens but if I then click on List 2, submenu 2 opens while submenu 1 remains open. However, when I click on List 2 again, instead of just closing submenu 2, it toggles ...

What is the most effective method for troubleshooting the html5lib.html5parser.ParseError that occurs due to an unexpected character following an attribute value

Currently, I am engaged in a personal project that involves using the chessdotcom Public API Package. My goal is to retrieve the PGN (Portable Game Notation) from the daily puzzle and store it in a variable, as this is required input for creating a chess g ...

What is the best way to align a scalable SVG image in the center?

My goal is to horizontally align this SVG within its container, which could be any div, body, or other element. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1250 190" preserveAspectRatio="xMidYMid slice" class="svg-content"> &l ...

Unable to make a request to the localhost node server via fetch API from an HTML page

Description: I am attempting to transmit JSON data from an HTML page to a Node.js server running locally on port 5000 using the Fetch API. Error Encountered: The request to 'http://localhost:5000/attend' from origin 'http://127.0.0.1:5501 ...

Ensure that div2 remains aligned with the left, bottom, and right edges of the screen, while also maintaining a consistent distance of 400px below div

Currently, I am faced with a challenge involving two divs: one positioned at the top (div1) and the other at the bottom (div2). The goal is to ensure that div2 maintains a consistent distance of 400px below div1 while also aligning its left, bottom, and r ...

Dynamic Text Challenge

Below is the code snippet I am working with: body{ width:100%; font-family:sans-serif; background: transparent; } .testimonials{ margin:0; display:grid; grid-template-columns: repeat(auto-fit,minmax(350px, 1fr)); grid-gap:2 ...

Guide to extracting a specific value from a JSON object with JavaScript

When working with JavaScript and fetching data from an API, the structure of the data retrieved may look something like this: [{ "word":"gentleman", "score":42722, "tags":["syn","n"] }, { "word":"serviceman", "score":38277, "tags":[ ...

Angular causing alignment issues for items not centered

I'm having trouble centering the contents of a div with my code. The properties I am applying don't seem to work. Any idea why this is happening? <div class='center'> <form (ngSubmit)="loginUser()" style="background: steel ...