DEV Community

Woffy
Woffy

Posted on

Hello !

Hello folks ,
My names Barry and I am a self-taught !
I need your help tho ,so lets get to the main point ,shall we - I was working on my site (HTML,CSS) and I wanted to insert text and a photo. I inserted them but the text is under the picture(I want it to be in the right side of the picture). May anyone help me solve this problem ?

Top comments (13)

Collapse
 
bsitko profile image
bsitko • Edited

Would def need to see the code to see how you tried to implement this.

Collapse
 
woffy profile image
Woffy

How can I send you the code ?

Collapse
 
woffy profile image
Woffy

I mean just drop the code text or a photo of the code

Thread Thread
 
bsitko profile image
bsitko

Plop the code text in here.

Thread Thread
 
woffy profile image
Woffy • Edited

div class="row">
div class="uslugi-content">
div class="row">
div class="img">
img src="uslugi.jpg" alt="Uslugi"/>
/div>
div class="text">
h4>Предлагаме:
h6>A lead span>UX & UI/span> designer based in Bulgaria
p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam


/div>
/div>
/div>
/div>

.Uslugi .uslugi-content {
background-color: white;
}

.Uslugi .uslugi-content .img {
flex: 0 0 33.33%;
max-width: 33.33%;
}

.Uslugi .uslugi-content .img img{
width: 100%;
display: block;
}

.Uslugi .uslugi-content .text {
background-color: white;
flex: 0 0 66.66%;
max-width: 66.66%;

}

Thread Thread
 
bsitko profile image
bsitko • Edited

Here's how I would do it:

Thread Thread
 
woffy profile image
Woffy

How did you do that :O

Thread Thread
 
bsitko profile image
bsitko

Review the CSS but the magic is in the FLOAT:LEFT. Plus, you need to wrap both sections (IMG and TEXT within the same div and give it a width of 100%)

Thread Thread
 
woffy profile image
Woffy

Thank you sir

Collapse
 
deciduously profile image
Ben Lovy

This sounds like a job for CSS float. You'll put both your image and your caption in one containing div - or you could use the <figure> tag - and apply CSS to your children to get one to float to the right of the other.

Collapse
 
woffy profile image
Woffy

I have already tried that and it did not work !?

Collapse
 
deciduously profile image
Ben Lovy

I think I need to see code.

Collapse
 
woffy profile image
Woffy

I will send the sites' code if necessary !