Divide Panel Content Enclosed by a CSS Figure

Need assistance with creating a diamond shape in CSS with two sets of text on each side of a separating line inside the diamond. I've tried aligning and floating the text without luck. Any help would be appreciated.

body {
background-color: pink;
}

/*Developer Section*/
#developer {
width: 100%;
height: 100vh;
}

.diamond {
position: relative;
width: 600px;
height: 600px;
border: 5px solid #65C8D0;
background-color: #65C8D0;
margin: auto;
margin-top: 300px;
transform: rotate(45deg);
}

.headshot {
position: relative;
z-index: inherit;
background-color: black;
width: 250px;
height: 250px;
border-radius: 50%;
border: 5px solid #65C8D0;
margin: auto;
margin-top: -850px;
}
.developer-inner {
position: relative;
color: whitesmoke;
z-index: 1;
text-align: center;
}

.headshot-text h1 {
font-weight: bold;
}

.split {
width: 3px;
height: 400px;
background-color: whitesmoke;
margin: auto;
}
<!--Dev Section-->
<section id = "developer">
<div class = "diamond"> </div>
<div class = "headshot"> </div>
<div class = "developer-inner">
<div class = "headshot-text">
<h1> Lorem Lorem </h1>
</div>
<div class = "developer-about">
<div class = "dev-panel-left">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
<div class = "split"> </div>
<div class = "dev-panel-right">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
</div>
</section> 

Answer №1

Implement the use of flex:

body{
  background-color: pink;
}

/*Developer Section*/
#developer{
    width: 100%;
    height: 100vh;
}

.diamond{
    position: relative;
    width: 600px;
    height: 600px;
    border: 5px solid #65C8D0;
    background-color: #65C8D0;
    margin: auto;
    margin-top: 300px; 
    transform: rotate(45deg);
}

.headshot{
    position: relative;
    z-index: inherit;
    background-color: black;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 5px solid #65C8D0;
    margin: auto;
    margin-top: -850px;
}

.developer-about {display:flex; align-items:center}

.developer-inner {
    position: relative;
    color: whitesmoke;
    z-index: 1;
    text-align: center;
    padding:0 40px;
}

.headshot-text h1{
    font-weight: bold;
}

.split{
    width: 3px;
    height: 400px;
    background-color: whitesmoke;
    margin: 0 40px;
}
<!--Dev Section-->
        <section id="developer">
            <div class="diamond"></div>
            <div class="headshot"></div>
            <div class="developer-inner">
                <div class="headshot-text">
                    <h1>Lorem Lorem</h1>
                </div>    
                <div class="developer-about">
                    <div class="dev-panel-left">
                        <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
                        </p>
                    </div>
                    <div class="split"></div>
                    <div class="dev-panel-right">
                        <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
                        </p>
                    </div>
                </div>
            </div>
        </section>

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

If the text is a single line, center it. However, do not center the text if it

Can we center align text horizontally if it occupies a single line, but refrain from center aligning and use white-space: normal when the text spans multiple lines (ideally without the need for JavaScript)? ...

Alter the typography of the text that has been enhanced by Google

I am attempting to modify the default font of certain text that is processed through google-code-prettify within an angular directive. The structure of the template served by my directive appears as follows: <pre class= "prettyprint" style= "border:1p ...

Stable navigation bar implemented with a grid design

I'm struggling with creating Navbars in Grid Layout. https://codepen.io/Aeshtray/pen/BdqeZL For mobile view, I want the Navbar to be fixed horizontally (as currently coded), but once reaching a width of 500px, I need it to become vertically fixed on ...

How to make browsers refresh cached images

.button { background: url(../Images/button.png); } Issue: To improve performance, static content on the website is cached with expiration headers. However, when an image changes, users must manually refresh their browser cache (Ctrl+F5 in IE). ...

Background wrapper does not reach full height of page

I am currently dealing with a website template that has a background image in the wrapper. However, when I view the site on a 13" laptop screen, the text extends below the fold because the wrapper only covers above the fold. This results in my content not ...

Prevent scrolling with absolute positioning

Here's a snippet of my HTML pseudocode: <div> <VideoAnimation /> <div className="under-animation"> // a lot of content goes here </div> </div> The issue arises from using absolute positioning on th ...

Blurring the background creates an "inset shadow" problem when transitioning

Problem: Strangely, when using Backdrop-filter: blur(Xpx); during a transition as shown below, unexpected "inset Shadows" mysteriously appear until the end of the transition. https://i.stack.imgur.com/uij7F.gif Illustration of the Issue Using jsfiddle Sp ...

Angular implementation of a dynamic vertical full page slider similar to the one seen on www.tumblr

I'm determined to add a full-page slider to the homepage of my Angular 1.x app After testing multiple libraries, I haven't had much luck. The instructions seem incomplete and there are some bugs present. These are the libraries I've experi ...

Setting the position of a tooltip relative to an element using CSS/JS

I'm struggling to make something work and would appreciate your help. I have a nested list of items that includes simple hrefs as well as links that should trigger a copy-to-clipboard function and display a success message in a span element afterwards ...

The CSS Grid does not align properly in the horizontal direction when displayed on mobile devices

I am currently working on a responsive layout where the header and footer should each take up around 5% of the screen space and remain fixed. The middle section should scroll based on the number of elements within it. Despite using the fr and % values, the ...

Decrease the heaviness of a Glyphicon

How can I make Glyphicons appear lighter in weight? I have utilized the "ok" Glyphicon <span class="glyphicon glyphicon-ok"></span> which currently displays as follows: Is there a method to decrease the weight of the icon in order to create a ...

Determine if the html element is wrapping to a new line when zoomed in or when the text size on Windows is increased

My webpage has 2 labels displayed side by side, but due to the system text size being set at 150% (which is recommended) in Windows, the second label does not have enough space and gets pushed below the first label. I am looking for a way to determine if t ...

The Transform feature doesn't seem to be functioning as expected within the Bootstrap

I was experimenting with creating a simple transform transition animation using css and js, so I wrote the following code: (test page) <!DOCTYPE html> <html> <head> <style type="text/css"> *{ ...

Creating an interactive R Shiny application with custom CSS styling and a modal

I am encountering an issue when trying to incorporate a modal dialog with a specific CSS style within a R Shiny app. Individually, I can successfully implement a modal dialog without the CSS style and apply the CSS style without any issues. However, when a ...

The not:first-child selector targets all elements except for the first one in the sequence

This is a simple js gallery. I am using not:first-child to display only one photo when the page is loaded. However, it does not hide the other photos. You can view the gallery at this link: (please note that some photos are +18). My objective is to hide ...

What is the secret to aligning two elements flawlessly?

I'm currently working on completing a theme and I've hit a roadblock. I am trying to add header support, but it's causing issues with my layout. Everything was running smoothly until I inserted this line of code: <img src="<?php heade ...

Fine-tuning CSS layout based on perspective alteration

I am working with the following code: function exportTableToExcel(tableID, filename = ''){ var downloadLink; var dataType = 'application/vnd.ms-excel'; var tableSelect = document.getElementById(tableID); var tableHT ...

Three divs arranged side by side with responsive design for mobile viewing

This code generates 3 divs for display. However, I am looking to optimize them for mobile devices. What steps can I take to accomplish this? Currently, the divs are oriented to the left and are not visible on a mobile device. I would like them to display ...

Include a floating element within a modal box

I am trying to display some cards within a Bootstrap modal form. Inside the modal, I want the cards to appear in two columns by using the "col-md-5" class. .mycard.col-md-5 card contents However, when I use the "col-md-5" class, it adds a property o ...

The issue with the sticky menu not functioning properly may be due to the use

Hey there, I'm facing an issue with the Navbar Menu (White Bar) on my website. It is working perfectly fine and sticking to the top as expected. However, the problem arises when I click on the Menu - the Sticky class stops working. Upon investigating, ...