stylesheet

Markup/Style best practices: How to efficiently distribute style rules over CSS classes?

半腔热情 提交于 2020-01-12 08:05:55
问题 Assume that I have some HTML page, and a corresponding CSS file. I'd like to add rounded corners to some elements. I want to alternate background colors on every other section. I want to add a hover state for each section heading. So forth and so on - I keep styling and styling and styling. It occurs to me that there are three extremes, where it concerns the "who, what, when, where, why and how" of distributing CSS rules over the markup by class, by id, and by hierarchy. Extreme #1: Every

Make entire CSS sheet !important

☆樱花仙子☆ 提交于 2020-01-12 06:38:47
问题 Is there a way to make an entire CSS Style sheet take precedence over another? I know you can do the !important but can I do that with one line rather than modify all thousand properties on the sheet? Thanks! 回答1: Make sure the stylesheet you want is called last (or a specific style you want is called last). For example, using this: span { color: red; } span { color: blue; } ...will turn all text in <span> 's blue. Take a look here. 回答2: Rules with identical specificity that come later will

Where should I place my Vaadin 10+ static files?

旧城冷巷雨未停 提交于 2020-01-11 19:55:14
问题 In Vaadin 10-14, where should I place my static files, such as CSS, JavaScript, and Polymer templates? How about static files such as images? Also, how do I import these files in Vaadin? Is there a difference between Vaadin 14 with npm and Vaadin 10-13 with bower? 回答1: All paths are relative to the project root, e.g. where the pom.xml file is located in a Maven project. JavaScript imported using @JsModule uses strict mode. Among other things, this means that global variables must be defined

PHP Routing - stylesheets have no effect

时光毁灭记忆、已成空白 提交于 2020-01-11 14:23:08
问题 I have created a basic Routing-system in PHP. The url is split into an array, so that i can decide what to show depending on the URL (ex: www.domain.com/page/option/param). So in my index.php I've defined a div for header, content and footer, and the /page/ determines which file to include in the content-div. The routing works, and the HTML is loaded, but the stylesheet doesn't seem to be. Neither does it work when I <link> the stylesheet directly in the file (and supposedly it's possible to

PHP Routing - stylesheets have no effect

旧城冷巷雨未停 提交于 2020-01-11 14:23:07
问题 I have created a basic Routing-system in PHP. The url is split into an array, so that i can decide what to show depending on the URL (ex: www.domain.com/page/option/param). So in my index.php I've defined a div for header, content and footer, and the /page/ determines which file to include in the content-div. The routing works, and the HTML is loaded, but the stylesheet doesn't seem to be. Neither does it work when I <link> the stylesheet directly in the file (and supposedly it's possible to

Margin and Padding of <Body> Tag

回眸只為那壹抹淺笑 提交于 2020-01-10 17:28:11
问题 I am writing a very simple HTML code which is listed below. Written in notepad and opening in IE-8 and Firefox (OS: Window Vista). <html> <body> <table border="1"><tr><td>test</td></tr></table> </body> </html> There is nothing special in the above code, It is creating some space from top left corner. Which can be easily removed by using the following code <body style="margin:0; padding:0"> Now i have find out the default margin and padding, which is 4 for Firefox and different for IE-8. <body

Margin and Padding of <Body> Tag

谁说我不能喝 提交于 2020-01-10 17:27:51
问题 I am writing a very simple HTML code which is listed below. Written in notepad and opening in IE-8 and Firefox (OS: Window Vista). <html> <body> <table border="1"><tr><td>test</td></tr></table> </body> </html> There is nothing special in the above code, It is creating some space from top left corner. Which can be easily removed by using the following code <body style="margin:0; padding:0"> Now i have find out the default margin and padding, which is 4 for Firefox and different for IE-8. <body

Adding CSS stylesheet to pages based on route in OpenCart

烈酒焚心 提交于 2020-01-10 15:40:27
问题 I'm using opencart (version 1.5.1.3.1) for a client store, and am wondering what the best way to code it so I can have certain stylesheets added for certain routes. For example, on my category page I'd like to have a different stylesheet to the default one, or one that will over ride the default styles with my custom sheet. I have use for this for more than one route obviously, and want to do this with as little edits required as possible, so as to reduce the amount of edits in the framework

Javascript file path not linking correctly

一世执手 提交于 2020-01-06 10:23:57
问题 I'm trying to pull different stylesheets in my main.js folder depending on the time of day. However, I keep receiving a file not found error in the console. When I open up inspect element. The day.css file appears in the DOM, but in the console I receive a file not found error and the file path is incorrect. The browser shows the path as: file:///Users/myname/Documents/directory/foodclock/day.css but what it should be is: file:///Users/myname/Documents/directory/foodclock/css/day.css ---This

How to dynamically modify the manifest file css file for Chrome Extension, or what is the correct way to toggle a stylesheet on/off?

淺唱寂寞╮ 提交于 2020-01-06 09:31:21
问题 Branching off my Other Question, a user successfully got me to serve a stylesheet but that is the wrong way; it is not what I needed to do. So I have come up with a more accurate question: Basically, you can make an extension permanently modify a web page by defining a content script in manifest.json. I need the ability to, on the click of a button within popup.html, toggle a stylesheet on or off. The answer to my other question I linked to, only allows my to serve a stylesheet, but that is