Jump to content

how to force width specified in css on pre code

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

Share this post

Link to post
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)



Share this post

Link to post
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;"

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...