Jump to content

how to force width specified in css on pre code


leela52452

Recommended Posts

my css contains

body {
  font-family: sans-serif;
  margin: auto;
  width: auto;

my <pre>

pre {
  font-family: sans-serif;
  background-color: #ffff00;
  color: #0a0a0a;
  line-height: 1.5em;
  letter-spacing: 0.12em;
  word-spacing: 0.16em;
  margin-bottom: 2em;
  font-size: 1.5em;
}

with and without pre code, it is not responding

Edited by leela52452
it was incorrect title
Link to comment
Share on other sites

52 minutes ago, dsonesuk said:

Missing } for body selector or is it typo? 

i rechecked again, it is partly cooy and paste.

i am unable to post URL here, hence attaching screenshots.

correct : portuges (in image)

incorrect : who am i (in image)

Screenshot_2019-12-11-15-50-43.png

Screenshot_2019-12-11-15-50-31.png

Link to comment
Share on other sites

The <pre> element by default allows text to overflow. You should use an element other than <pre>.

If you still want a <pre> element there, you can override its behavior with CSS using "white-space: normal;"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...