• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

indent property

Participant ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

Hi just wondering whether its possible to indent a line in a text box that is not a first line.

 

Trying to get the website email line to be in line with the rest of the text but it is slipping below the image as it should.

 

Thanks a million 🙂

Views

315

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 4 Correct answers

Community Expert , Jul 15, 2022 Jul 15, 2022

there is a big piece of information missing... what is your HTML structure... it's based on that, that the CSS will be able to correctly define the property to set.
but at first sight, text-indent would not be the property to target... rather margin or padding... and if your A TAG is inside the text block... nothing should be applied

Votes

Translate

Translate
LEGEND , Jul 16, 2022 Jul 16, 2022

Simplest way would be to use 2 columns. Insert your image in the 1st column and your text in the 2nd column. That way the text cant move under the image or if your text is wrapped in a <p> tag or <div> tag then add some left-margin to it, so the text is pushed clear of the image.

 

As Birnou says, for more advice we would need to see the html you are using. Can you post it in the forum?

Votes

Translate

Translate
Community Expert , Jul 16, 2022 Jul 16, 2022

Short answer:  Use 2 columns.  Put image in column 1, put text in column 2.

 

image.png

 

Working example with CSS Grids:

 

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS Grid</title>
<meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
.grid_container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
grid-auto-rows: 
grid-gap: 1em;
border: 1px dotted silver;
}
.grid_contai
...

Votes

Translate

Translate
Community Expert , Jul 16, 2022 Jul 16, 2022

Or if you use Bootstrap, insert 2 Bootstrap Cards like so.

 

image.png

 

Votes

Translate

Translate
Community Expert ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

there is a big piece of information missing... what is your HTML structure... it's based on that, that the CSS will be able to correctly define the property to set.
but at first sight, text-indent would not be the property to target... rather margin or padding... and if your A TAG is inside the text block... nothing should be applied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

Thanks so much for getting back to me 🙂

 

This is the html

 

<a href="http://www.broomecamelsafaris.com.au" target="_blank" rel="noopener noreferrer">Website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:bookings@broomecamelsafaris.com.au">Email</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="tel:80419 916 101">Tel: (08) 0419 916 101</a>

 

and I tried

 

<a class="IndentForTours" href="http://www.broomecamelsafaris.com.au" target="_blank" rel="noopener noreferrer">Website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:bookings@broomecamelsafaris.com.au">Email</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="tel:80419 916 101">Tel: (08) 0419 916 101</a>

 

CSS

.IndentForTours {margin-right: 168px;}

 

This is what I got 😞

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2022 Jul 16, 2022

Copy link to clipboard

Copied

Simplest way would be to use 2 columns. Insert your image in the 1st column and your text in the 2nd column. That way the text cant move under the image or if your text is wrapped in a <p> tag or <div> tag then add some left-margin to it, so the text is pushed clear of the image.

 

As Birnou says, for more advice we would need to see the html you are using. Can you post it in the forum?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2022 Jul 16, 2022

Copy link to clipboard

Copied

Short answer:  Use 2 columns.  Put image in column 1, put text in column 2.

 

image.png

 

Working example with CSS Grids:

 

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS Grid</title>
<meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
.grid_container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
grid-auto-rows: 
grid-gap: 1em;
border: 1px dotted silver;
}
.grid_container div {
vertical-align: middle;
width: 100%;
height: auto;
}
</style>
</head>
<body>
<div class="grid_container">
<div>
<img src="https://dummyimage.com/200x200" alt="Placeholder">
</div>
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa similique adipisci ad odio voluptas quod, laborum eligendi harum aliquid repudiandae! Aspernatur, possimus tenetur porro modi in rerum quaerat quod labore!</p>
</div>
</div>
</body>
</html>

 

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2022 Jul 16, 2022

Copy link to clipboard

Copied

Or if you use Bootstrap, insert 2 Bootstrap Cards like so.

 

image.png

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 16, 2022 Jul 16, 2022

Copy link to clipboard

Copied

LATEST

Thanks so much everyone .. will take on your advice for the 2 columns

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines