How can I change css stylesheet with dart?
Tags: html,css,dart,dart-polymer
Problem :
I'm working on a project for an exam and I need to change the stylesheet's name in the page. How can I do this with Dart? I've seen that I can edit every attribute of my css from Dart but I've already made others css that I would like to use in my page. For example, I have this in my html page:
<link href="stile.css" rel="stylesheet" type="text/css">
I need to edit the page to make this
<link href="stile-blu.css" rel="stylesheet" type="text/css">
How can I do this?
Solution :
Assuming your <link ...>
element is in the <head>
element
document.querySelector('#button').onClick.listen((_) {
var stile = document.head.querySelector('link[href="stile.css"]');
stile.attributes['href'] = 'stile-blu.css';
});
If you add an id
attribute to your link element the selector can be simplified
<link id="mystyle" href="stile.css" rel="stylesheet" type="text/css">
document.querySelector('#button').onClick.listen((_) {
var stile = document.head.querySelector('#mystyle');
stile.attributes['href'] = 'stile-blu.css';
});
CSS Howto..
Since the h3 is wrapped in an a that uses $primary-color you can use: a[data-reveal-id] h3 { color: inherit; } http://codepen.io/anon/pen/iflCA...
1) Trim image with <div> and overflow:hidden: div.trim { max-height:100px; max-width: 50px; overflow: hidden; } <div class="trim"><img src="veryBigImage.png"/></div> 2) Use max-width: 50px; and max-height: 100px for image itself. So image...
According to the jQuery documentation the hidden selector can return true for any of the following cases They have a CSS display value of none. They are form elements with...
Surround everything in a content div with clear: both CSS property, and this should make everything stack correctly, or rather prevent things floating over it (see this link). It's difficult...
http://jsfiddle.net/hamzanisar/d1mdm2tk/3 Maybe this will work for you. Just re-size the view port and it will be one line for responsive you can adjust as you want. I'm using row and...
This should give you all you need: http://www.wpdfd.com/editorial/thebox/deadcentre3.html <div id="horizon" style="background-color: transparent; text-align: center; position: absolute; top: 50%; left: 0px; width: 100%; height: 1px; overflow: visible; visibility: visible; display: block">...
Since you are not using Django internal server (rightly so), you need to make your production web server aware of the static file location. There is an example in Django...
Remove ' a' where that, for example, '#polaroid_contact a:hover' would look like '#polaroid_contact:hover'.
function triggerCarousal(){ setTimeout(function() { //Add a timer (Show for 5 seconds) featuredCounselorCarousel(); }, 5000) } function featuredCounselorCarousel() { hideCurrentCounselor(); showCurrentCounselor(); //Show the Counselor First }// End featuredCounselorCarousel function showCurrentCounselor()...
It appears that you are using a URL instead of the local file path. For example include('http://example.com/css/styles.css'); will produce your error but the following should not include(public_path().'css/styles.css'); ...
Presumably you mean that below 520px you'd like them to be stacked vertically, but otherwise side-by-side? I would do this instead of floating. (It should be noted that you have...
You shouldn't/can't do this with CSS. You need either: For a non-programmatic solution: <link rel="import" href="sidebar.html"> save your sidebar in a sidebar.html file and call it with this snippet. Check...
You can also have an image sprite, which is a single image that has both of the arrows, preventing the need for fetching two images. Use CSS to change the...
I decided that I would refactor some code from Minify to allow for the abstract css transformation I needed. <?php //This class is heavy borrowed from Minify_ImportProcessor class CSSImporter {...
Try this: <style type="text/css"> a img { text-decoration: none } // Images within </style> However, this is awfully general and if your anchors have padding, it won't work entirely, there...
Create a div with .span12 and include another level of row/span with your .span5 and span7 jQuery ...
You can use a css technique with multiple backgrounds here: .bg-secondary { background-image: url(fallback.png); background-image: url(image.svg), none; ----- ----- } This works because it just so happens that the browser...
The input tag needs to have a value attribute to tell the browser what text to display – Cody Guldner Mar 22 at 20:34
Please check this link http://rafael.adm.br/css_browser_selector/#contributors Theree is detailed documentation about this javascript...
Couple of things you are not doing ok: to set the size of the dialog, don't use style. use 'width' and 'height' properties. you shouldn't have to add classes to...
I haven't seen a need to in ages (like Safari 2). Make a new question about the actual problem you're having and someone can probably tell you how to fix...
You can try this approach: jsFiddle Instead of using the borders to create the slanted effect, I'm using an :after pseudo element to create it. This allows me to set...
I can think of two alternative approaches: Post process getDirectoryContents Call getDirectoryContents then filter out the values you don't care about. Something like: xs <- getDirectoryFiles "" ["//*.js"] need [x...
What you've done is correct, they're both using up 50% of their parent, you need the parent to be 100% of the page for them to both be 50% of...
align="center" in your table tag Demo 1 or mention margin: 0 auto; in your css for table class Demo 2 Don't forget to put "" double quotation around classes name...
html <div id="ban01" class="banner ban01"> </div> <div id="ban02" class="banner ban02"> </div> <div id="ban03" class="banner ban03"> </div> <div id="ban04" class="banner ban04"> </div> style .banner { height: 50px } .ban01 { background:...
I'd recommend writing your own generator, but if you want to alter the default you can: 1 - For a single app: Freeze rails and change the stylesheet the scaffold...
There is no need add !important until you are going to override already existing css line. So the code would be like this, #content img { max-width: 100%; height: auto...
It's the developer's choice, ultimately. Keeping in mind the target audience, if you have a lot of Opera Mobile users than of course you'd want to keep around -o- prefixes....
One way could be to make a row like this: <div class="row"> <div class="col s6"></div> <div class="col s6"></div> </div> and then fill the columns with the posts. Keep adding posts...