+ 1
Position
How to change position of text and image
7 Antworten
+ 1
You can use various properties to change the position of text and image. It depends on your requirement.
I suggest you go through position property and flex concept.
As 🇮🇱 Radin Masiha 🇮🇱 given code will work. You can try it by adjusting right and left property value like below
position: absolute;
right: 50px;
left: 50px;
And you can also use top and bottom property as well.
position: absolute;
top: 50px;
bottom: 50px;
+ 3
// HTML
<div class='center>
<h2> Your text</h2>
<img src='your-image-url'/>
</div>
// CSS
.center {
display : flex;
align-items : center;
justify-content : center;
width : 100%
padding : 25px 50px;
}
I think, It will help you, But I recommend you to use Grid : )
+ 2
/* CSS */
display: block;
position: absolute;
right: /*.....*/;
left: /*.....*/;
+ 2
🇮🇱 Radin Masiha 🇮🇱 the position does not have a block value.
+ 1
Hey there
For controlling the position of an element in the HTML/CSS you have to use the position property in your CSS file
For more info, you can check this link: https://developer.mozilla.org/en-US/docs/Web/CSS/position?v=example
+ 1
It all depends on the structure of the html-document and the set goal.
For example:
p {
text-align:center;
}
img {
position:relative;
left:80%;
}
+ 1
Solo, typographical error! 😁