How would you the length of a bordered region (that holds text) in HTML?

14 Views Asked by At

I'm making a webpage using HTML and I am using borders around my text to give it a text box-type look. The problem I'm having is there are pictures and other elements I want to be beside the bordered text region. I currently have the picture beside the bordered text region as I wish however, the text continues running under the picture and I would like to fix this.

I tried searching on W3shools and a regular google search but couldn't find a suitable solution.

1

There are 1 best solutions below

0
El Captus On

may be is a z-index problem, or just where you are putting your text, in this example if i didn't miss understand shows how the text is always in a side of the image

html>>>

<div>
    <img src="./picture.png" alt="this is a picture">
    <div><p>some text</p></div>
</div>

css>>>

div{
    display: flex;
}
div>div{
    border: solid black 1px;
    height: fit-content;
}