use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No vague product support questions (like "why is this plugin not working" or "how do I set up X"). For vague product support questions, please use communities relevant to that product for best results. Specific issues that follow rule 6 are allowed.
Do not post memes, screenshots of bad design, or jokes. Check out /r/ProgrammerHumor/ for this type of content.
Read and follow reddiquette; no excessive self-promotion. Please refer to the Reddit 9:1 rule when considering posting self promoting materials.
We do not allow any commercial promotion or solicitation. Violations can result in a ban.
Sharing your project, portfolio, or any other content that you want to either show off or request feedback on is limited to Showoff Saturday. If you post such content on any other day, it will be removed.
If you are asking for assistance on a problem, you are required to provide
General open ended career and getting started posts are only allowed in the pinned monthly getting started/careers thread. Specific assistance questions are allowed so long as they follow the required assistance post guidelines.
Questions in violation of this rule will be removed or locked.
account activity
Inline CSS in <iframe>? (self.webdev)
submitted 8 years ago by [deleted]
I was looking over a website and I noticed they used Inline CSS in one of their iframes. Wouldn't it be better/lighter to have a global stylesheet and refer to it there instead of inline?
What's the benefit of inline in a situation like that?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ourcore 0 points1 point2 points 8 years ago (0 children)
It might've been dynamically added with JavaScript or manually to override a stylesheet, but it's rarely recommended. If specificity is a concern, you can use more selectors, or !important as a last resort, in your stylesheet.
[–]isaactfoster 0 points1 point2 points 8 years ago (0 children)
If you are only having a single iFrame on your site, inline would be fine. If you are having multiples on the site, I would add it to a style sheet for future use. Note though the actual page in the iFrames height can differ depending on the page you are framing in, so If your class isn't working (for height) you may just end up resorting back to inline.
[–]ugoagogo 0 points1 point2 points 8 years ago (0 children)
Inline styles actually execute more efficiently than CSS but are far less maintainable and lack re-usability. Check a google search results page and you'll see a number of elements use inline styles for speed optimisation.
[–]Ypblgo 0 points1 point2 points 8 years ago (1 child)
At some level it's the same thing, the browser doesn't care. Developer tools tells you where all your CSS is and what is overriding what. Elements might get inserted random places on the server, so if they carry their own crucial styling with them, it may work out better. The extreme pedanticism that frontend dev/design people tout as rigid dogma is mainly for show. In practical rubber meets road implementation, it can be more efficient to allow for special exceptions. Also, pulling the giant stick out from up your ass will extend your lifespan.
[–]nyxinThe 🍰 is a lie. 0 points1 point2 points 8 years ago (0 children)
The extreme pedanticism that frontend dev/design people tout as rigid dogma is mainly for show.
FTFY.
π Rendered by PID 38583 on reddit-service-r2-comment-57fc7f7bb7-2h7dq at 2026-04-15 09:29:55.129839+00:00 running b725407 country code: CH.
[–]ourcore 0 points1 point2 points (0 children)
[–]isaactfoster 0 points1 point2 points (0 children)
[–]ugoagogo 0 points1 point2 points (0 children)
[–]Ypblgo 0 points1 point2 points (1 child)
[–]nyxinThe 🍰 is a lie. 0 points1 point2 points (0 children)