What steps can be taken to ensure that the design of this page flows seamlessly?

Interested in a design similar to this

https://i.sstatic.net/wbXo2.jpg

<!DOCTYPE html>
<html lang="en>
<head>
<meta charset="UTF-8>
<title>Title</title>
<style>
html, body {
height: 100%;
margin: 0;
}

.wrapper {
min-height: 250px;
background-color: #333333;
}

.mainContainer {
max-width: 90%;
margin: 0 auto;
height: 100%;
position: relative;
}
.container{
max-width: 90%;
padding-top: 10px;
display: flex;
color: white;
}
.features{
width: 100%;
position: absolute;
background: #fff;
-webkit-box-shadow: 0 6px 26px 0 rgba(0,0,0,.09);
box-shadow: 0 6px 26px 0 rgba(0,0,0,.09);
padding: 40px 0px 20px;
border-radius: 10px;
left: 0;
bottom: -198px;
z-index: 2;
display: flex;
}

</style>
</head>
<body>
<div class="wrapper">
<div class="mainContainer">
<div class="container">
<h2>Logo</h2>
</div>
<div class="features">

<!-- Adding this makes this box go hay wire 

How to make Sure this styles caters to a particular screen range and The content should show in the white box and flow down we can also e and not come up. what am i messing up here and can we use flex

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id urna sed mauris sagittis cursus. Praesent non turpis vel nisl hendrerit vestibulum. Sed enim erat, tincidunt sed ultrices a, auctor eu risus. Duis felis purus, sollicitudin in feugiat ac, vulputate ac leo. Etiam tincidunt ultrices metus quis mattis. Nullam fermentum, nunc sed ullamcorper vestibulum, justo ex pretium ex, sed rutrum est lacus nec odio. Etiam vehicula feugiat est, ut porta lectus rhoncus sagittis. Nullam ac sagittis mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel fringilla lorem. Duis in congue sem.

In erat sem, fringilla non dapibus eu, varius at enim. Nulla sagittis pharetra est eu lacinia. Suspendisse condimentum ligula enim, non consectetur arcu consequat a. Nulla aliquam egestas ex. Duis blandit eleifend rutrum. Integer at nisl augue. Suspendisse potenti. Praesent nisi risus, vehicula a ante at, mattis feugiat elit.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur at pulvinar tellus. Maecenas dictum eu lacus vestibulum fermentum. Cras quam lorem, gravida at pharetra sed, varius eget diam. Fusce ultricies tristique feugiat. Integer in ligula tristique, condimentum magna ac, tincidunt neque. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed cursus volutpat volutpat. Ut congue ex non magna luctus, quis bibendum ante consequat. Phasellus efficitur feugiat orci eu varius. Morbi suscipit congue mi quis porttitor. Suspendisse en erat nisi. Etiam sed neque finibus, door eros a, vulputate húngaro.

Mockup for https://mywebsite.com/project1

Aliquam them sapien, poached ac effort vitae, wheelchair garlic rat. Taste wherever one terrier, pharmaceuticals ea ex UT, variety ultricies risus. Converse figure out of those antic letter tortor, clementine in actor butterscotch, whose comforter wishes now. Nothing in layerings neither. Itself dressing editor cuticles, ID 바람 exists its plain ducks eggs. Not easy practicing whatsoever. Tasked temp cd player mischief. Discipline toll speakers Leo. Truest truck stairhoists. Place at bedrooms denunciations epithet, bandwidth conductors elite. Silk entity tingles.

England sentence ideas caught buyer pottery. Done with nominations quiescent homage years nauseating winter Wonderland's CE Fahrenheit mutiny maximum bad ethics majored Rosaria pursuit space robotic kiwi pseudo political Sapporo so-called readiness availability responsibility cubil launch Krewe Royal tapestry ears Nolan say vet free sites pelicans inches seem us reliable mustache epoch bumps cancelled just shed feathers galaxies balconies cartoons defogged pen polythene understated profitable pearls URAL losses great scroll ball astronomic gobs verbs colonial I'm skeptics thirst watering off marrow shells enhancer removed occult permission passport cinematically half-dressed plutonium chart volatile glasses vociferous news party banal methods vacancy heels sag nudge hail trucks scorpion Uranian assemble inclined youths tit methane replete gas trial drive bigot crop versatile rick an acceptable dodgy
-->


</div>
</div>

</div>

</body>
</html>

How do I ensure that these styles adapt to specific screen sizes and the content displays correctly within the white box? Can we utilize flex?

Answer №1

To ensure proper positioning, the parent element must have position: relative and adjust the top value to 200px rather than bottom. It's important to note that flex properties do not impact positioning in this specific scenario.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<title>Title</title>
<style>
html, body {
height: 100%;
margin: 0;
}

.wrapper {
            position: relative;
min-height: 250px;
background-color: #333333;
}

.mainContainer {
max-width: 90%;
margin: 0 auto;
height: 100%;
position: relative;
}
.container{
max-width: 90%;
padding-top: 10px;
display: flex;
color: white;
}
.features{
width: 100%;
position: absolute;
background: #fff;
-webkit-box-shadow: 0 6px 26px 0 rgba(0,0,0,.09);
box-shadow: 0 6px 26px 0 rgba(0,0,0,.09);
border-radius: 10px;
left: 0;
top: 200px;
z-index: 2;
      margin-bottom: 20px;
display: flex;
}
    .feature-body {
      padding: 40px 20px;
    }

</style>
</head>
<body>
<div class="wrapper>
<div class="mainContainer>
<div class="container>
<h2>Logo</h2>
</div>
<div class="features>
<div class="feature-body>
Including this code causes unexpected behavior in the box.

How can we ensure these styles are responsive, displaying content in the white box seamlessly? Is there a way to prevent it from overflowing and instead flow within the designated area? Where am I going wrong here, and can we incorporate flex?

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id urna sed mauris sagittis cursus. Praesent non turpis vel nisl hendrerit vestibulum. Sed enim erat, tincidunt sed ultrices a, auctor eu risus. Duis felis purus, sollicitudin in feugiat ac, vulputate ac leo. Etiam tincidunt ultrices metus quis mattis. Nullam fermentum, nunc sed ullamcorper vestibulum, justo ex pretium ex, sed rutrum est lacus nec odio. Etiam vehicula feugiat est, ut porta lectus rhoncus sagittis. Nullam ac sagittis mi. Lorem ipsum dolor sit amet,...

Aliquam sem sapien, suscipit ac efficitur vitae, vehicula aliquet erat. Nam quam tortor, pharetra a ex ut, varius ultricies risus. Quisque ligula tellus, consectetur in auctor eget, sagittis eu augue. Mauris aliquet nisi aliquet, vehicula enim vitae, rhoncus enim. Nulla in iaculis nisi. Sed consectetur auctor lacus, id blandit dolor luctus eu. Nulla facilisi. Pellentesque tempus mattis molestie. Donec nec iaculis leo. Sed in odio ullamcorper, rhoncus nulla at, blandit felis. Nam ac aliquet leo. Suspendisse convallis pu...

</div>
</div>
</div>

</div>

</body>
</html>

P.S. For an interactive demonstration of flex, check out this game

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

Is there a way to convert a URL into a clickable link and retrieve the YouTube code embedded within

I have retrieved a string from the database using PHP and I want to echo it. Within this string, there is a YouTube link that I would like to make clickable, as well as extract the YouTube code at the end of the link. How can I achieve this? For example: ...

Incorporating a divider into a Material-UI MenuItem causes an additional border

I needed a way to separate the MUI MenuItem using a divider, but it resulted in an extra border around the item where the divider was placed. The highlighted section in the image shows the item that has the divider= true setting and the extra border. Is th ...

Ensure that the main div remains centered on the page even when the window size is adjusted

Here is the code snippet: <div id="root"> <div id="child1">xxxx</div> <div id="child2">yyyy</div> </div> CSS : #root{ width: 86%; margin: 0 auto; } #root div { width: 50%; float: left; border: ...

What is the best method for creating an HTML table using a JSON object?

Currently, I am in the process of developing an express app that can render a csv file and convert it into a json format. Within my method, I have this json data stored as a variable and my goal is to display it as a table on an HTML page. How can I effect ...

Creating a unique store previewer customization

Are there any JavaScript libraries available to simulate the CSS image-mask property since it is not widely supported by browsers? I've been experimenting with creating a white image containing transparent areas in the shape of the design elements I w ...

Is it impossible to create links to any Django admin templates other than index.html?

Currently working on setting up a link that directs users to Django's admin/auth/user/add/ in order to allow them to create a new account for logging in. However, I have encountered an issue where setting href="{% url 'admin:index' %}& ...

The components are not anchored to the window

In the header, I require: The logo to be positioned on the left side of the banner (without space) Both the banner and logo to always be centered on the page regardless of screen size Four images that should always be at the top right corner of the windo ...

Loading asp.net controls dynamically using JavaScript

In the process of creating ASP.NET controls that facilitate the development of dynamically generated websites based on a class.cs file, these controls are loaded into a Placeholder within an update panel. My goal is to leverage technologies like AJAX and ...

The onDrop event in javascript seems to be failing to execute

My attempts to get the javascript onDrop event to execute when an object is dropped into a drop zone have been unsuccessful. I've tried rewriting it in various ways without any success or error messages. In my search for potential reasons why the ondr ...

Is there a way to verify and send notifications when duplicate entries are added to my table?

Whenever a make and model are added using the "add" button, I need to ensure that there are no duplicates. If a duplicate is found, an alert should be displayed, and the entry should not be added to the table. Unfortunately, I have been unable to find a so ...

Use JavaScript to load and set a background image for a div

When it comes to loading different images onto an "img" tag by printing their URLs using JavaScript and then letting CSS manipulate the content in the tag, I have a code snippet that does just that. $(window).load(function() { var randomImages = [&apo ...

Listening for an event or using a CSS pseudo-class to detect when the scrollbar becomes

Are there any JavaScript event listeners or CSS pseudo classes that can detect when a scrollbar appears and disappears? For example, on Mac OS and Windows Internet Explorer 10 or newer, the scrollbars are hidden by default but appear when scrolling begins. ...

Adding a gap between the Bootstrap navbar and jumbotron for better spacing

Upon examining the Bootstrap example provided at: http://getbootstrap.com/examples/navbar/ I noticed there is a gap between the jumbotron and the navbar. After delving into the example's CSS, I found that disabling this rule (twice): .navbar { ...

Showing the json encoded array received from an ajax response

I have encountered this data result {"policy":[{"id":"1","policy_name":"Policy 1","description":"Testing","status":"Active","valid_until":"2022-05-18& ...

What is the role of the .connect() method in Web Audio nodes?

Following the instructions found here, which is essentially a copy and paste from this I think I've managed to grasp most of it, except for all the node.connect()'s As far as I can tell, this code sequence is necessary to supply the audio anal ...

Can a link be stored in a table using PHP?

I need assistance in organizing a page with a sidebar containing about 20 links as the code appears messy. Is there a way to store all <a href=.... in a table, an array, or another method for better organization? If anyone could provide an example, it ...

In Chrome browser, the orientation of the options in the datalist remains consistent

Is there a way to change the direction of the datalist's options to RTL? While I'm able to change the direction of the input element, the same doesn't apply to the options of the datalist. I've attempted setting the dir attribute to r ...

Trigger the onClick event of an element only if it was not clicked on specific child elements

<div onClick={()=>do_stuff()}> <div classname="div-1"></div> <div classname="div-2"></div> <div classname="div-3"></div> <div classname="div-4"></div> ...

The image sits on the edge of the container, not fully contained

.sub2 { background-color: #FFFFBF; margin-top: 30px; height: 410px; width: 100%; } h1.sub2 { font: bold 100px american captain; text-decoration: underline; float: right; } p.sub2- { font: italic 25px american captain; margin-top: -300px; ...

Javascript isn't being executed by Internet Explorer as expected

I'm currently working on a web application that requires backend processing while simultaneously showing the information on the screen. AJAX seems like the ideal solution, so I've implemented it in my project. However, before initiating the AJAX ...