dynamic-css

Is there a way to reference an existing CSS style from another CSS style using CSS or javascript?

瘦欲@ 提交于 2019-12-10 00:51:10
问题 If I have a style defined .style1 { width: 140px; } can I reference it from a second style? .style2 { ref: .style1; } Or is there a way via javascript/jQuery? --- Edit To clarify the problem, I am trying to apply whatever style is defined for a #x and #c to .x and .c without altering the CSS as the CSS is going to have updates that are out of my control. I used width but really the style would be something more complex with font, border and other style elements being specified. Specifying

Dynamic URLs in CSS/JS

…衆ロ難τιáo~ 提交于 2019-12-09 04:39:22
问题 I'm splitting up one of my larger apps and introducing a 'cdn' url to house common objects like CSS, javascript, and images to avoid duplication. What I need to do, though, is have separate URLs for our dev environments, so I may have: http://cdn-dev.example.com http://cdn-qua.example.com http://cdn.example.com depending on what environment we're working in. I can get this to work for things that are generated by our PHP code, but I'm at a loss for the .css and .js files that will be called.

Facebook like status div

女生的网名这么多〃 提交于 2019-12-06 06:20:30
问题 I'm looking for a footer like facebook has but only use CSS to style it no js. As you can see here http://dl.getdropbox.com/u/5910/Jing/2009-02-03_1256.png it always stays at the bottom even if I scroll down. http://dl.getdropbox.com/u/5910/Jing/2009-02-03_1258.png 回答1: For all browsers, save for IE6, do this: div#footer { bottom: 0; width: 100%; height: 25px; position: fixed; } I know you mentioned not wanting to use JavaScript, but as for IE6, it's been my experience that you may have to

Changing Background for Night & Day using php?

眉间皱痕 提交于 2019-12-04 23:00:05
问题 I'm working on a tumblr page. I have two different backgrounds for the html page and I want the DAY background to display from 7am to 8pm and the night background to display from 8pm to 7am. I decided to do this in php, but i'm a total newb when it comes to php. My friend sent me an example code that I could use. But I have no idea what to do with it. Can you guys help. Here's the example code. <?php header('content-type: text/css'); date_default_timezone_set("America/Vancouver"); $now = date

Facebook like status div

独自空忆成欢 提交于 2019-12-04 14:01:52
I'm looking for a footer like facebook has but only use CSS to style it no js. As you can see here http://dl.getdropbox.com/u/5910/Jing/2009-02-03_1256.png it always stays at the bottom even if I scroll down. http://dl.getdropbox.com/u/5910/Jing/2009-02-03_1258.png For all browsers, save for IE6, do this: div#footer { bottom: 0; width: 100%; height: 25px; position: fixed; } I know you mentioned not wanting to use JavaScript, but as for IE6, it's been my experience that you may have to resort to some sort of JavaScript expression in the CSS to get it to work as smoothly as this CSS does in

Dynamic URLs in CSS/JS

拥有回忆 提交于 2019-12-03 03:17:38
I'm splitting up one of my larger apps and introducing a 'cdn' url to house common objects like CSS, javascript, and images to avoid duplication. What I need to do, though, is have separate URLs for our dev environments, so I may have: http://cdn-dev.example.com http://cdn-qua.example.com http://cdn.example.com depending on what environment we're working in. I can get this to work for things that are generated by our PHP code, but I'm at a loss for the .css and .js files that will be called. For example, how do I make something like: .cool-button { background-image: url('http://cdn.example.com

How to render a template with dynamic CSS?

与世无争的帅哥 提交于 2019-12-01 02:13:51
问题 I want to create a dynamic CSS file in a view and then render a template which loads that CSS file. Depending on the arguments given to the view, the CSS may have different values at certain places every time the view is called. How would I go about doing that? (I should add that I have no experience with writing files in Python/Django.) Here is a simplified example of how I think it should work: # urls.py urlpatterns = patterns('', (r'^myview/(?P<color>[0-9a-f]{6})/$', create_css_file), ) #

Reference app relative virtual paths in .css file

让人想犯罪 __ 提交于 2019-11-29 23:00:48
Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. Example: When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might resolve to /Images/Test.gif (depending on the virtual directory for the application). I, obviously, want to avoid having to modify the .css file between environments. I know you can use Page.ResolveClientUrl to inject a url into a control's Style collection dynamically at render

How do you dynamically load a CSS file into a Flex application?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 10:37:05
I know that you can apply CSS in order to style objects in Flex using the StyleManager: http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html You can also load compiled CSS files (SWFs) dynamically: http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html However, I'm dynamically creating my CSS files using a web GUI and a server-side script. If the CSS is changed, then the script would also need to compile the CSS into an SWF (which is not a viable option). Is there any way around this? The application of CSS in Flex is handled on the server side at compilation

Reference app relative virtual paths in .css file

怎甘沉沦 提交于 2019-11-28 20:03:11
问题 Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. Example: When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might resolve to /Images/Test.gif (depending on the virtual directory for the application). I, obviously, want to avoid having to modify the .css file between environments. I know you