How to style a 3rd-party iFrame [duplicate] - css

This question already has answers here:
How to apply CSS to iframe?
(28 answers)
Closed 9 years ago.
Is there a way to CSS-style a 3rd party iframe? For example, with a Twitter widget, I would like to change the font size.
How would I do this?

I don't think you do... For all intents and purposes that iframe is another document and is completely outside of your control (as long as it's 3rd party and / or stored in another domain).
In the case of twitter you can always configure the widget itself when you start it but as long as you're trying to access / alter most properties of the document inside the iframe, you're sold.
Long story short: as far as I know you're dependant on whatever tools the 3rd party provides you. Of course, you can always do hacks (intensive curl calls, parsing and rewriting) but that would be like killing a fly with a really big cannon.
What are you exactly trying to achieve?. Maybe there's a way the 3rd party allows you to...

Related

Is it possible to implement a full css page into google dev tools? [duplicate]

This question already has answers here:
Inject CSS with chrome developer tool?
(9 answers)
Closed 5 years ago.
I have a project where I'm writing new CSS for a client's website, but I have no actual access to their code. To get around this, I've been editing the CSS in browser element by element using google dev tools. The big problem with this method is that once I've written all this new CSS, if the browser is refreshed I lose all of it.
Question is, does google dev tools have a feature where I can upload a whole new CSS document to override what it's displaying in browser?
I'm going to guess no, but if it was possible it would make my life a lot easier moving forward. Thank you all.
You could inject a script using JavaScript. You could have the code run automatically with a something like TamperMonkey. GreaseMonkey for FireFox is similar and will give you many more examples. You could also use the script to remove any stylesheets on the page right before you inject the reference to yours.

Is there a difference between custom.css and other css files? [duplicate]

This question already has answers here:
css best practices - combining all css into a single stylesheet?
(4 answers)
Closed 8 years ago.
Are there any notable differences between placing all my CSS into custom.css, and dividing it up by controller (For example, putting all user-related CSS into user.css, etc)?
Dividing it up is more organized, but one concern I have is that if I have to write '#import "bootstrap";' at the top of every css file, my app might load bootstrap seperately for every file, thereby possibly increasing the load time.
Any input would be appreciated!
Adding css in different files is, as you said, purely for organizational purposes. It has no functionality differences.
However, when you refer to the #import bootstrap implementation, i would suggest against adding that in every css file, for the reason you stated above (because you can miss something or you can link it twice). If you simply add a reference link at the top of your template html page (if you are using one) or at the top of your html pages (if you are not using one), it ensures that bootstrap is loaded once per page (or once per session if its a single page application) so you wont have to worry about missing bootstrap or loading it multiple times unnecessarily.
hope this helps!
I think it is a matter of personal preference. the more you have code, the more difficulty you will have when debugging or going through the file. For me, I usually store them under the root folder in a Css folder. and I also like breaking them down and not mixing my bootstrap files with my custom cssbut that's just me.
I also split it using specific values like for example if i have a css for a specific browser, i put it in the folder a folder like css/firefox/overrider.css
I think it is just a matter of preference. for the import, individual csswill be better (correct me if I am wrong). It is better explained here: Import vs Link files

Best practices for structuring CSS code [duplicate]

This question already has answers here:
Best way to structure a CSS stylesheet [closed]
(2 answers)
Closed 8 years ago.
I am creating a design for a mid-sized Web application. It's my first time, and there is no established design process at my workplace. Previous projects are small internal applications, and the back-end developer used a minimal design just enough to make stuff align where it should.
I started doing the design for each type of page separately, and created a new CSS file for each type of page, e.g. a separate one for input forms, another one for the search interface, and so on. I also made one large file with elements used everywhere (header, footer, buttons, warning messages and so on). It was the only reasonable structure I could think of.
I've been at it for a while, and I'm now noticing that I've created some sort of chaos. When I have an element and need to change the definition of its style, I always have to go through Inspect Element and then Visual Studio's search function, which is still reasonably efficient. But I also frequently find myself looking at definitions in the stylesheet, having no idea what they are for, or if they're still in use at all - maybe we have already thrown out the elements which use them, or they were an attempt to solve a problem which got a better solution.
I am already trying to give good, semantic names to my classes, but it's not sufficient, and sometimes even impossible - every workaround I use seems to leave me with names like .centeringWrapper.
What is a good, workable structure of CSS code which prevents these problems? What principles can I apply to arranging the code?
How can I divide the code into files so I can find the correct file?
How to structure code inside the files so I can keep my orientation within a file?
How to keep the overview of different definitions for the same element which are used within different #media blocks?
Any advice for making my work less messy is welcome.
The best practice for structuring your CSS is to structure your CSS. By that I mean have a system. It doesn't really matter what your system is, as long as it makes sense to you and your team and people can consistently maintain it (at least for a reasonable length of time).
I can tell you one way not to do it, though and that's by not designing each page separately with its own CSS.
I think you've figured this out already, but it's worth repeating.
Now, there are times when I've broken this rule. But it's rare and it's typically on small marketing-centric sites where I simply have 4 very different pages. In general, though, you want to re-use as much of your CSS as you can across all your pages.
One way to achieve that is to start with a pre-existing structure by working off of a CSS framework. A common one is Bootstrap, but there are literally dozens and dozens of options out there.

What are CSS variations? [duplicate]

This question already has answers here:
Create a variable in .CSS file for use within that .CSS file [duplicate]
(13 answers)
Closed 8 years ago.
Im working on a website and my boss wants me to use CSS variations and I dont know what he is talking about.
Let's say I have 20 different elements using #7d2d39, rather than having:
background-color:#7d2d39
color="#7d2d39"
All over the style sheets he wants me to call it using:
background-color:red1"
color="red1"
and somewhere define what "red1" is that way we can globally change one hex color vs. changing it 20 times? It makes sense as I type it, but I dont think this exists.
You'd need to use something like LESS which supports dynamic stylesheets and variables.
CSS preprocessors are a way of making CSS more "programmatic" by using things like functions and variables. The two most popular are:
SASS
LESS
And then there's others:
Google Closure Stylesheets
Stylus
And there's projects like Twitter Bootstrap which uses LESS. There's nothing directly usable in CSS at this moment. It all requires either a JavaScript or a backend processing to convert the LESS/SASS file into CSS.
But it can help developer keep code organized and cleaned and make managing updates faster.
I've never heard of the term "CSS Variants" before but I would suspect your boss might have meant "CSS Variables", which is more what you're describing. But variables are only a part of the functionality preprocessors offer.
I hope that helps!
I think he is talking about css variables but this is just a draft. LESS and SASS are options, too.

Adding tagging functionalities to photos in my website [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Image tagging like facebook in asp.net
I am developing a website. I want to add a functionality like tagging photos like we have in facebook and orkut.
please suggest how can i do that?
Is there any open source gallery(or paid) which i can directly plug in.
Any solution is welcomed as soon as possible.
Yes. Face.com already provides an API for this functionality.
Take a look at this website for information on a C# Wrapper.

Resources