| |

VerySource

 Forgot password?
 Register
Search
View: 1270|Reply: 6

How to indent
tags in css? (anxious)

[Copy link]

4

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-6 12:40:01
| Show all posts |Read mode
The extensive text returned by php from the mysql database is added with a <br /> tag after each paragraph. How can this be indented in CSS?
Returned text without <P> </ P> tag?
Is there any other way for masters?
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-7 01:51:01
| Show all posts
Try line-height
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-9 12:54:01
| Show all posts
Adding <p> </ p> to the server and returning it to the client can at least solve this problem.
Reply

Use magic Report

4

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-9 13:36:01
| Show all posts
Mr. Upstairs just set the row height, what's the use?
Can he indent the first line of a paragraph?
Also, is that css does not recognize <br /> tags, can not set classes and define styles?
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-11 14:00:01
| Show all posts
You can put inside
<div id = "content"> <p>
... here is the text fetched by php
</ p> </ div>

You can replace the content.innerHTML with javascript
"<p>" + str.Replace ("<br />", "</ p> <p>") + "<p>"
Have you tried it? Is javascript running on the client? You can also handle it on the server side. Can you take it for yourself?
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-13 15:45:01
| Show all posts
You can use padding-left
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-16 22:45:01
| Show all posts
Do you want to indent the first line (indent the first word)?
I read it wrong, I think you want to indent the line spacing of br!

You can improve it according to the method ofsunray, which can be assembled on the server side, such as:

str = "<p>"&replace(str,"<br/>","</p><p>")&"</p>"

Write CSS styles on the client:

p {text-indent: 4px;}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list