how to load the dynamically changed css file
Tags: javascript,css
Problem :
I created a widget and changed the style sheet dynamically using javascript. href attribute is updated, but the styles not applying in the html page.
Is there anything i have to do additionally to load the css file..?
Solution :
You have the wrong version of the module, which, given that the module comes standard with Orchard, means that you've been installing a version from the gallery on top of your existing version. You'll want to restore the version that came with Orchard.
CSS Howto..
padding on btn and btn-sm is messing up the text-align. your buttons are too small to accommodate the padding. setting padding:0 5px; works for me. see the codepen here. alternatively...
Its because of 1px border and default padding which is 1px if you remove the border and make padding 0 then the result is- table { border-collapse:collapse; } td {...
You can do it by adding text-align:center; and also position: fixed; to your :after pseudo element. #frame { position: fixed; top:50%; left:50%; transform:translate(-50%,-50%); background-color: black; &:after { position:fixed; content: 'Caption...
this is hiding the problem in fact, but may be sometime can be usefull: (i used zoom to change size of the container) .box { position: relative; margin: 20px; width:...
#logo would need to float: left then you should probably add a clear: both styled container after .secondardMenu or wrap them both with a clearfix class'd container...
You're not seeing any of the stylesheet styles because you haven't attached your test element to the document. After creating your testElement, doing: document.body.appendChild(testElement); Should suffice. Alternatively, if having the...
Remove the white space between your link tags. jsFiddle example <a class="menu" href="/test/index.php">Home</a><a class="menu" href="/test/profile.php">Profile</a><a class="menu" href="/test/settings.php">Settings</a><a class="menu" href="/test/image.php">Image</a><a...
If you could accept using :focus instead of hover, you can use: var links = document.getElementsByTagName('a'); links[0].focus(); JS Fiddle demo. Or var linkToFocus = document.getElementById('link'); linkToFocus.focus(); JS Fiddle demo. This...
What I do is I wrap the field with a div with the class carrier-wave-field, then I can do something like this .carrier-wave-field input { color: red; /*or whatever you...
Like this: jsFiddle. Make the child div appear first as a child of childDiv2 and keep the CSS as-is.
Update Given your comments, we are more or less back to basics now :) We're setting the main content to take up the entire width but leave 300px on the...
You need to alter the sequence of the bold and italic property in the source code of wysiwyg.js i simply altered the position of the following code bold: { groupIndex:...
You can use flexbox! Its part of CSS3 and it's supported in all major browsers! Working example: http://jsfiddle.net/976eh/3/ the HTML: <nav> <a>Hello</a> <a>World</a> <a>Hello</a> <a>World</a> </nav> the CSS: nav {...
Edited for working solution. I assume that your object for streams is similar to what I created there, at least enough so. $(document).ready(function() { var streams = { home: [...
You were almost there. You just need to add two lines of code: html, body { height: 100%; } Since you're using a percentage height in .contentBlock, you need to...
Here is the way to fix the issue, your html working fine only the css need to be edit. CSS .container { width: 40%; height: 107px; background: #fff; position: relative;...
I'm not aware of a CSS-only solution, but you could set the width of the progress element before adding the class. In doing so, it will transition from the previous...
A form? Like this http://www.w3schools.com/html/html_forms.asp <form> First name: <input type="text"> Last name: <input type="text"> <input type="submit" value="Submit"> </form> ...
Try to use the following: WebClient webClient = new WebClient(); XHtmlPage page = webClient.getPage("…"); HtmlElement div = page.getHtmlElementById("elem_container"); WebWindow window = webClient.getCurrentWindow(); Window jscript = (Window) window.getScriptObject(); HTMLElement element =...
As suggested by Pete in another thread: You need to increase the min-width of #main-header to around 950px
you can use appendTo() which will add the items to the bottom of .navigation-menu: $('ul.nav-bar li').each(function() { $(this).appendTo('ul.navigation-menu'); }); And you can use media queries to hide the other div...
What I noticed playing around with it is if I rotated a square around the Y axis, the side sticking out towards me would be "clickable," while the side pointed...
You are looking for margin. The margin CSS property sets the margin for all four sides. It is a shorthand to avoid setting each side separately with the other margin...
You can use display: table-cell on each column and display: table on parent (*). That will force your "cells" to have the same height and stay on the same row....
In your style.css file on line 88 you have: q:before, q:after{ content: "'";} which is adding the ' character. Remove it or override it to an empty string (content: "")....
I think that you can't do it with css. However you can use jQuery to do it. Quite easy: HTML (add classes to li elements to identify them in your...
Following css will make center both div. display:flex and position:absolute will do the trick. align-items: center; will center child div vertically and justify-content: center; will horizontally inside parent. div.father {...
I tried this workaround, it works: var styleElem=document.createElement('style'); styleElem.innerHTML='::selection{ background:transparent; }'; // enable in some cases document.head.appendChild(styleElem); // disable when not needed window.getSelection().removeAllRanges(); document.head.removeChild(styleElem); ...
Just remove the justify-content style. Elements that won't fit on the first row, will break to the second, starting on the left side. To make the code more fancy i've...
You can use the removeClass() method; if you call it without an argument it removes all classes: $('#nav ul a').removeClass(); Description: Remove a single class, multiple classes, or all classes...