• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • META /
avatar image
1
Question by jlmakes · Jun 10, 2016 at 01:37 PM · css

Untentional CSS property padding-left: 15px on code tags?

Looks like the <code> tag is unintentionally using padding-left: 15px.

How things look: Incorrect padding on code snippets

How things should look: Correct padding on code snippets


Note: Current stylesheet is combined.css.h875472960.pack

incorrect.png (1.9 kB)
correct.png (1.9 kB)
Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Owen-Reynolds · Jun 10, 2016 at 03:02 PM 0
Share

It's been this way ever since the switch, over a year ago. I assumed it was a bizarre style choice, but looking at the CSS, you're right -- it does looks like a mistake (took me $$anonymous$$utes to find where Safari hid "Show Source," but then it shows all the style sheets very nicely.)

Searching there for "code," there's a nice section for "code pre," then just below are the specifics for just code (inline code,) and then code-blocks (I checked, yes, code blocks are a code tag in a pre tag.) So far, looks fine. A long-standing problem was scrolling on huge code sections, so someone obviously added "white-space: pre-wrap" to fix that. Oddly, inline code is set to no-wrap (but people rarely post 120+ character inline code, so maybe that's fine.)

But then you notice it uselessly has "white-space pre" just in front of pre-wrap. O$$anonymous$$ - maybe that's for off-brand browsers? Then, way, way, way down below, there's a second section setting just code back to to pre-wrap. It's like they didn't know you could just edit the part above. And then that funny 15px part.

It almost looks like someone was experimenting, and just tacked on that extra "code" style. Or is that part of a nested style-sheet (I can't use Safari well enough to know.) Or were they wanting to indent code blocks (pre code) 15px?

avatar image jlmakes Owen-Reynolds · Jun 10, 2016 at 03:48 PM 0
Share

It’s a remarkably simple fix, which unfortunately can mean it goes ignored for a remarkably long time.

Looks like some 3rd party called Pretty Print is used for the syntax highlighting, and a padding-left: 15px is used on the pre.prettyprint selector.

This leads me to believe that the padding-left: 15px on the code selector could be a part of the Pretty Print stylesheet that doesn’t really work in this context (seeing as the code selector has padding: 2px 4px declared earlier in the source).

I use Chrome, so for the time being I have installed the Stylebot extension and manually overwritten the incorrect padding-left.

avatar image Dave-Carlile Owen-Reynolds · Jun 10, 2016 at 04:45 PM 0
Share

$$anonymous$$y understanding is that they're using a third party product for UA and don't have access (or the desire) to fix things without waiting for the product to be updated. So I don't anticipate it being fixed.

avatar image jlmakes Dave-Carlile · Jun 10, 2016 at 05:03 PM 0
Share

answers.unity3d.com is served from a different IP address than their main site, main blog, etc—so you’re probably right, it’s likely a hosted service that the answers subdomain redirects to.

However, I think it’s safe to assume they have access in some form or another to an ad$$anonymous$$istrative panel of whatever platform they’re using—including the ability to update configuration, create new moderators, and I’m sure change templates… which would include the ability to include new stylesheets if they can't actually modify the culprit.

The desire to fix it however, as you’ve mentioned, is probably $$anonymous$$imal.

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

45 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[Unity Answers] Inline Code has incorrect padding-left attribute 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges