Code style borken

Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Tue Apr 21, 2015 1:08 pm
Reply with quote
Report this post
Hi!

When text iт code style have more than 1 line in looks broken

Image

Page with problem: http://macburo.com/isekrety/uskoryaem-m ... kon-v-os-x
User avatar
Expert Boarder

GK User
Tue Apr 21, 2015 5:45 pm
Reply with quote
Report this post
Hi,
it's because by default it was designed for short text only.
But If you want I can find temporary fix.
User avatar
Platinum Boarder

GK User
Tue Apr 21, 2015 5:47 pm
Reply with quote
Report this post
As you wrote
this short code can fix a little bit
Code: Select all
pre, code {
    padding: 10px !important;
}
User avatar
Platinum Boarder

GK User
Tue Apr 21, 2015 9:49 pm
Reply with quote
Report this post
But what if need to add big code???

Image
User avatar
Expert Boarder

GK User
Sat Apr 25, 2015 1:54 pm
Reply with quote
Report this post
Hey! I need help... Anybody here?

I found, that <pre> </pre> works fine.


http://monosnap.com/image/UdR7rSlkSOmO1ohB6o5gWtTcUclJyy.png


Is it possible to make <code> style same as <pre> ?
Thanks.
User avatar
Expert Boarder

GK User
Sat Apr 25, 2015 5:47 pm
Reply with quote
Report this post
Probably yes.
I will check again and send a code here.
User avatar
Platinum Boarder

GK User
Sat Apr 25, 2015 5:53 pm
Reply with quote
Report this post
Ok,
1) Please add / use :
Code: Select all
code {
    white-space: pre-wrap;
    word-wrap: break-word;
}


2) please use <br> inside "code" to break too long text - like it was in our example then text will be shown correctly :whistle:

<code> <br> Bla1 Bla1 BLa1 <br> Bla2 Bla2 Bla2 <br>
</code>
User avatar
Platinum Boarder

GK User
Sun Apr 26, 2015 9:23 am
Reply with quote
Report this post
Hi!
I added white-space: pre-wrap; word-wrap: break-word; in override css - but it's don't work.

I created 2 blocks pre and code with same content inside and without any <br />.

at the bottom of this page:
http://macburo.com/isekrety/otklyuchaem ... nij-v-os-x

Image

What should I do to make display <code> blocks same as <pre>?
User avatar
Expert Boarder

GK User
Mon Apr 27, 2015 11:23 am
Reply with quote
Report this post
So I don't have idea.
Both <pre> and<code> have & use this same CSS code now.
so it must be something deeper - according to W3C rules.

I suggest to use <pre> if you want ideal appearance and leave <code> alone.
User avatar
Platinum Boarder


cron