Encasing a Div Element Within Another Div with Scrolling Functionality

https://i.sstatic.net/53aZZ.png

Trying to figure out if I can achieve this design through coding. I've noticed that wrapping text around a div is possible, but it's not working for me. Could it be because of the scrolling? Wondering if only non-scrolling text can wrap around a div...

.bgvalka {
width: 500px;
height: 600px;
background: #433b34 url(https://i.imgur.com/oRivmFt.png);
padding:0px;
background-repeat:no-repeat;
}

.textbgvalka {
width:400px;
height:381px;
padding:169px 50px 50px 50px;
}

.textvalka {
width: 195px;
height:281px;
font-size:10px;
background: transparent;
font-family: 'Manrope', sans-serif;
line-height:10px;
text-align:justify;
color:#000;
overflow:auto;
padding-right:5px;
}

.picvalka {
width: 120px;
height:120px;
padding:15px;
float:left;
margin:400px 0px 0px 0px;
background: rgba(255,255,255,.7);
float:left;
}

---

<div class="bgvalka">
<div class="textbgvalka">
<div class="picvalka">
<img src="https://i.imgur.com/99V3jeX.png" width="120">
</div>
    <div class="textvalka">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ut viverra magna. Etiam non justo augue. Ut accumsan sapien sollicitudin turpis molestie, vel imperdiet nisl cursus. Aenean cursus magna mattis lectus efficitur, id congue mauris hendrerit. Nullam pretium turpis odio, ut tincidunt sapien porttitor sed. Integer elit elit, sagittis a libero id, pulvinar convallis eros. Aliquam ut diam fringilla, semper urna eu, fermentum mauris. Integer sapien nibh, rhoncus vitae orci interdum, interdum facilisis nulla. Sed mattis iaculis dolor sit amet condimentum. Mauris in elit turpis. Ut consequat dignissim leo vel vestibulum. Curabitur rutrum arcu elit, non maximus tellus luctus et. Pellentesque finibus fermentum pellentesque.<br><br>

Maecenas venenatis urna orci, ac eleifend eros iaculis vitae. Donec quis enim suscipit, venenatis dolor eu, feugiat ipsum. Morbi nec metus ut leo ullamcorper aliquam. Curabitur dolor magna, aliquet sit amet posuere nec, dignissim vitae orci. Aenean mattis suscipit quam. Mauris egestas pulvinar enim, pellentesque condimentum massa ullamcorper ac. Sed ac commodo nisi. Integer finibus a sem in ornare. Mauris euismod auctor convallis. Phasellus purus erat, accumsan sed mi eget, sagittis vehicula quam. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut rutrum dui non lorem dapibus suscipit.<br><br>

Suspendisse pharetra non ligula non luctus. Morbi bibendum ac risus ut ornare. Cras lobortis, nibh at pulvinar iaculis, orci felis ultrices felis, at rutrum odio nibh maximus turpis. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In hac habitasse platea dictumst. Nulla eget accumsan sem. Sed mauris orci, aliquam sit amet magna nec, vulputate posuere sem. Mauris vel congue mi, sed consectetur arcu. Cras lobortis odio eu magna sagittis ullamcorper. Integer a ex tincidunt, gravida orci quis, tempus velit. Nullam convallis eleifend lacus accumsan cursus. Etiam auctor sollicitudin ligula, vel efficitur felis mollis et. Maecenas imperdiet porta nibh, sit amet viverra lorem sodales nec. Pellentesque sit amet purus semper, rutrum augue non, hendrerit purus.<br><br>

Donec laoreet fringilla dignissim. Curabitur gravida ligula dui. Aliquam lectus ligula, rutrum ut pretium ac, imperdiet ut elit. Curabitur ac volutpat odio, ac viverra enim. Aliquam erat volutpat. Suspendisse in ultrices diam. In imperdiet est non arcu porttitor, eu eleifend leo eleifend. Curabitur cursus nec augue non dapibus. Maecenas vitae odio varius nisl ultrices cursus ut sed est. Proin laoreet aliquam nibh, ut semper ante egestas a.</div>
</div>

</div>
</center>

This is the code I'm currently tinkering with, although it's far from being complete as I keep adjusting and testing it repeatedly. (I have repositioned the large image to the left and plan to place the smaller "Notes/Tag/Outfit" text on the right to avoid interfering with the scroll bar)

Answer №1

CSS

.bgvalka {
width: 500px;
height: 600px;
background: #433b34 url(https://i.imgur.com/oRivmFt.png);
padding:170px 0 0;
background-repeat:no-repeat;
}

.textvalka {
width: 270px;
height:280px;
margin: auto;
font-size:10px;
background: transparent;
font-family: 'Manrope', sans-serif;
line-height:10px;
text-align:justify;
color:#000;
overflow:auto;
padding:5px;
}

HTML

<div class="bgvalka">
  <div class="textvalka">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ut viverra magna. Etiam non justo augue. Ut accumsan sapien sollicitudin turpis molestie, vel imperdiet nisl cursus. Aenean cursus magna mattis lectus efficitur, id congue mauris hendrerit. Nullam pretium turpis odio, ut tincidunt sapien porttitor sed. Integer elit elit, sagittis a libero id, pulvinar convallis eros. Aliquam ut diam fringilla, semper urna eu, fermentum mauris. Integer sapien nibh, rhoncus vitae orci interdum, interdum facilisis nulla. Sed mattis iaculis dolor sit amet condimentum. Mauris in elit turpis. Ut consequat dignissim leo vel vestibulum. Curabitur rutrum arcu elit, non maximus tellus luctus et. Pellentesque finibus fermentum pellentesque.<br><br>

     Maecenas venenatis urna orci, ... elements.

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 getting the HTML input textbox onChange event to fire properly?

This is the code I have been working on: <script language="JavaScript"> function toggle() { if (this.value=='1') { document.getElementById('dbOn').style.visibility='visible'; } el ...

Adjust the height of column divs to equal the height of their parent container

Looking for a solution: I have multiple divs in a column layout and I want them to expand to match the original height of the parent. The parent's height is not fixed as it is part of a flex-based page design. Can this be done? In the example provid ...

CSS, the vertical alignment feature is not functioning properly in Mozilla Firefox

Creating a webpage with fixed height header and footer, and a contentWrapper div in between that stretches to the maximum screen height. The content div inside the contentWrapper needs to be vertically and horizontally aligned within its parent div. This s ...

What are the steps for utilizing the first-child pseudo-class?

I'm looking to target the first instance of a div with the class "aProduct", but I'm having trouble figuring out how to do so. Here is what I've attempted: <div id="kasticketProducts"> <div class="aProductHeader"></div> ...

JavaScript animation not functioning properly when height is set to "auto"

Can someone help me figure out why setting the height to "auto" in the code snippet below isn't working as expected? I want the DIV to adjust its size based on the content, but it's not happening. Any ideas on how to fix this issue would be great ...

Shifting the final child to the front position proves unsuccessful with jQuery

I have attempted to move the last element in my list to the first position upon clicking, but unfortunately, it is not working as expected. I followed the advice provided in response to a question on the following page: Move last child to first position. W ...

No reversematch error occurs despite the successful import of the primary key

Even though the pk has been imported, I am still getting a NoReverseMatch Error. Error Traceback: Reverse for 'profile_page' with no arguments not found. 1 pattern(s) tried: ['profile_page/(?P<pro>[^/]+)$'] My urls.py configurat ...

The hamburger icon menu is malfunctioning

Having some trouble with adding a hamburger button using Bootstrap classes. The button is not showing up at all. In fact, none of the Glyphicons seem to be working for me. Did I miss something? Maybe forgot to import something? I would really appreciate ...

I'm looking to make some adjustments to my export button (btnExport) in C# - what changes can I

This is the code I wrote for a basic program that exports data from a Datatable to a CSV file. The program functions as a website used to manage a database and convert it into a .csv file with the click of an export button. using System; using System.Coll ...

Troubleshoot: Inability to highlight a column and row in a table using ::after and ::before

To create a hover effect where the corresponding column and row are highlighted when the mouse is on a cell, as well as highlighting the row for player 1's actions and the column for player 2's actions, I attempted the following code: /* CSS Cod ...

To trigger a pop-up window displaying a link upon clicking the submit button

I am attempting to create a popup box that displays an application accepted message and a link back to the home page upon clicking the submit button. However, the .popup box is not appearing after validation. This is the content that should be displayed w ...

Struggling with aligning an image and text side by side in CSS

Struggling to get my text and image perfectly aligned horizontally? Despite being aligned, the image makes it seem otherwise. https://i.stack.imgur.com/u1QOh.png CSS Code: /* Copyright © 2016 Dynavio Cooperative */ .navbar { width: 100%; border ...

Tips on detecting a collision between a cube mesh and the boundaries of a browser using ThreeJS

I'm a beginner in 3D games and ThreeJS. In the image above, my Mesh is located at the left boundary of the browser with a position of -1035 instead of 0. This leads me to question what exactly is the relationship between mesh.position.x in ThreeJS and ...

Only a handful of pictures all aligned in a row

How can I style two images to be on the same line? <div> <img src=""/> <img src=""/> </div> While this code gives me images on the same line, there are spaces between them. Using inline display did not solve the issue. Any suggest ...

Illuminate the image upon checking the checkbox, as well as when clicking on the image itself

Issue with Implementation <div> <input type="checkbox" id="check" class="check-with-label" /> <label for="check" class="label-for-check">My Label <img class="product-add-image-preview" src="http://ecx.images-amazon.com/images ...

Finding the index number of a DIV element when it is clicked

Here is an example of the HTML structure I am working with: <div id="preview-wrapper"> <div class="dz-preview dz-image-preview"> <a class="rotate-a" href="javascript:void(0);"> <img class="rotate" src="public/a ...

Enhance the visual appeal of your website by incorporating a dazzling sparkle effect using

I have implemented the magnificPopup script on my gallery page. Check out magnificPopup on Github In addition, I have added a sparkle effect using this script: Try out the Sparkle Effect Currently, the sparkle effect only appears when hovering over eac ...

Matching utility types and themes in Tailwind CSS

I encountered an issue while trying to implement the Tailwind plugin in my project. It seems that a TypeScript error has occurred. I'm curious about the data types of matchUtilities and themes. Can someone provide some insight? const plugin = require( ...

Put the title tag within a script in the shell

Within an HTML snippet, I currently have a <title> tag that I need to change on a monthly basis when generating reports. While I can manually update it each month, I am looking for a way to automate this process so the title reflects the relevant rep ...

Having trouble managing external CSS files on Django 1.3 development server

Trying to get external CSS files to work on the Django 1.3 development server has been a challenge. Despite reading through Django's 'managing static files' guide and various similar Stack Overflow questions, I still can't seem to figur ...