Search Results

Search found 16166 results on 647 pages for 'css layout'.

Page 3/647 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Practices for keeping JavaScript and CSS in sync?

    - by Rene Saarsoo
    I'm working on a large JavaScript-heavy app. Several pieces of JavaScript have some related CSS rules. Our current practice is for each JavaScript file to have an optional related CSS file, like so: MyComponent.js // Adds CSS class "my-comp" to div MyComponent.css // Defines .my-comp { color: green } This way I know that all CSS related to MyComponent.js will be in MyComponent.css. But the thing is, I all too often have very little CSS in those files. And all too often I feel that it's too much effort to create a whole file to just contain few lines of CSS - it would be easier to just hardcode the styles inside JavaScript. But this would be the path to the dark side... Lately I've been thinking of embedding the CSS directly inside JavaScript - so it could still be extracted in the build process and merged into one large CSS file. This way I wouldn't have to create a new file for every little CSS-piece. Additionally when I move/rename/delete the JavaScript file I don't have to additionally move/rename/delete the CSS file. But how to embed CSS inside JavaScript? In most other languages I would just use string, but JavaScript has some issues with multiline strings. The following looks IMHO quite ugly: Page.addCSS("\ .my-comp > p {\ font-weight: bold;\ color: green;\ }\ "); What other practices have you for keeping your JavaScript and CSS in sync?

    Read the article

  • Are There Specific CSS Selectors Targeting IE10?

    - by kunambi
    Since IE is getting rid of conditional comments in version 10, I'm in dire need to find a "CSS hack" targeting IE10 specifically. NB! It has to be the selector that's getting "hacked" and not the CSS-properties. In Mozilla, you can use: @-moz-document url-prefix() { h1 { color: red; } } While in Webkit, you usually do: @media screen and (-webkit-min-device-pixel-ratio:0) { h1 { color: blue; } } How would I do something similar in IE10? TYIA.

    Read the article

  • css to display three coloumn content

    - by arpymastro
    I am trying to get three column output using <div> for each. Right now my div on the left is lined properly even the middle one, but when I try to put right it is just clipping down. CSS /* left div */ #left-sidebar, #right-sidebar { width:15%; height:700px; float: left; padding-left: 15px; padding-top: 20px; } /* middle div */ #mid-content { width:75%; padding-left: 30px; padding-top: 20px; } /* right div */ #right-sidebar { float:right; }

    Read the article

  • CSS : How can I add shadow to a label or box

    - by Rachel
    I have an button just as have Ask Question on SO and here is the CSS for it: .rfs .grey_btn{ float: right; margin: 15px 5px; } Now I have to add border shadow to it and I have tried border-radius and box-shadow but it does not give me proper result. Also other question is that I have a label or box say and now I want to increase size of that box so that I have move the text inside that box to right, currently if I move it to right than it reaches the end limit of box and so I want to increase the size of box so that I can push text more towards right. Hope I have made my question clear. Any guidance would be highly appreciated. Thanks.

    Read the article

  • Fulfilling strange requirements with CSS (kind of simulating frames)

    - by Bernhard V
    Hi! I'm struggling to find a way to code a site according to our strange requirements. The site should be displayed correctly in all browsers from IE6 to Opera. The website is structured in three parts. It contains a header at the top, a navigation on the left an the rest of the screen should be filled with the content section. The following picture should help you better understand my description. Here comes the kicker: Each of the three sections should be scrollable separately and no browser scrollbar should appear. The page should be displayed similar as if it would use frames. Of course, on a big enough screen, no scroll bars should appear. It doesn't matter which way is used to display the site, although frames aren't an option an divs would be preferred. There are two conditions: The site should always fill the whole browser screen. The header and the content section should reach to the right border of the page, and the navigation as well as the content to the bottom. As soon as the site is scaled down -- whether due to resizing the browser window or due to a smaller resolution -- a scrollbar for every single section should appear, but no "browser scrollbar" for the whole page. The header should always retain it's height and the navigation always it's width. Do you know a way how all this can be achieved? Yours Bernhard

    Read the article

  • Help with CSS - getting an element to fill 100% of the remaining vertical space

    - by Jack W-H
    Hi folks I'd consider myself a reasonable standard CSS/XHTML chap but I'm pretty baffled by this. The problem is available here: http://furnace.howcode.com - (note that the site is still in development, most stuff doesn't work, and it's likely to change fairly quickly as it is updated often). Basically I've got a fluid layout that needs to work in the same proportions on any resolution. Here's a screenshot of how the designer invisioned it (I apologise for my Paint-tool anotations): I want the tabs and the search box to STAY at the top of Col2, whilst there should be a scrollable area beneath it where the results are returned. I want NO vertical viewport scrolling, only within the 100%-height area thingy. My problem is this. If you take a look at http://furnace.howcode.com, you'll see that I've got a bit of a problem. I've made a placeholder black-background div which I will turn into the Tabs shortly. However I want the Col2 div to float BENEATH this and fill 100% of the remaining vertical height (i.e. go to the bottom of the screen, nomatter what the resolution is) and Col3 to be in the place where Col2 currently has been put (it normally is there automatically, when Col2 is in the right place!). I hope that makes sense. If you need to me to clarify please just ask. Cheers! Jack

    Read the article

  • CSS Width Greater then Page Width without Horizontal Scroll (overflow:hidden not an option)

    - by Anders H
    I've got a basic layout going in 960.gs. One line of text is absolutely positioned, starting within an inner DIV and exiting only the right side of the page. Here's a screenshot: The issue is that as the text appears as a series of unbroken words, if the width of the text box doesn't extend beyond the end of the page, it breaks some distance from the edge. overflow: hidden; doesn't do the trick because I need to set the width wider than the page. float won't work because the text can't escape the width of the inner DIV. I can't set it outside the inner DIV and just position it there as the same problem will still exist. The code is basically as simple as: <wrapper (containing) DIV> <text stripe DIV> <p></p> </text stripe DIV> </ wrapper DIV> I know I've done something like this before and I can't for the life of me remember what I ended up doing. Thanks.

    Read the article

  • Keeping footer visible and height 100% in CSS

    - by vtortola
    I'm trying to create a very simple page that contains a container, a header, a left column and a footer: <containter> <header /> <content /> <leftBar /> <footer /> </containter> I want to use the 100% of the height, as I can do with the width, but I simply dont get it work.At his moment I'm usingmin-height, but how could I use theheight:100%` ? What I like is that the footer is always visible, and you scroll the content. Current CSS body { font-family: Verdana; font-size: 0.8em; background-color:#f1f1f1; } #container { border:solid 2px Black; position:absolute; left:10%; width:80%; margin:auto; } #header { height:20px; background: #DDDDDD; } #leftBar { width: 20%; background: #669966; min-height:600px; postion:absolute; top:20px; bottom:20px; } #content { float:right; background-color: #cdcde6; position:absolute; left:20%; right:0px; bottom:20px; top:20px; padding:5px; } #footer { position:absolute; height:20px; }

    Read the article

  • CSS - Overlaying one image on top of another

    - by Jack W-H
    Hey folks! I can't best describe this in words, so I'll show you with pictures. Here's how my designer intends the Gravatar images to look in the sidebar of our site: Here's the overlay image I made (screenshotted from Photoshop): Here's how it looks right now... Not quite ideal, I think you'll agree. This is the CSS code I am using: .gravatarsidebar { float:left; padding:0px; width:70px; } .gravataroverlay { width:68px; height:68px; background-image: url('http://localhost:8888/images/gravataroverlay.png'); } And here's the XHTML (and a sprinkle of PHP to fetch the Gravatar based on the user's email address, which is fetched from our database): <div class="gravataroverlay"></div> <div class="gravatarsidebar"> <?php $gravatar_link = 'http://www.gravatar.com/avatar/' . md5($email) . '?s=68'; echo '<img src="' . $gravatar_link . '" alt="Gravatar" />'; ?> </div> So what can I do? I can't use relative positioning as it makes the word 'Search' in the div below stay moved to the right. Thanks for your help! Jack

    Read the article

  • CSS import or multiple CSS files

    - by David H
    I originally wanted to include a .css in my HTML doc that loads multiple other .css files in order to divide up some chunks of code for development purposes. I have created a test page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>The Recipe Site</title> <link rel='stylesheet' href='/css/main.css'> <link rel='stylesheet' href='/css/site_header.css'> <!-- Let google host jQuery for us, maybeb replace with their api --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="/js/main.js"></script> </head> <body> <div id="site_container"> <div id="site_header"><?php include_once($r->base_dir . "inc/site_header.inc.php"); ?><!-- Include File, Update on ajax request. --></div> <div id="site_content"> Some main content. </div> <div id="site_footer"><?php include_once($r->base_dir . "inc/site_footer.inc.php"); ?><!-- Include File, Update on ajax request. --></div> </div> </body> </html> File: /css/main.css /* Reset Default Padding & Margin */ * { margin: 0; padding: 0; border: 0; } /* Set Our Float Classes */ .clear { clear: both; } .right { float: right; } .left { float: left; } /* Setup the main body/site container */ body { background: url(/images/wallpaper.png) repeat; color: #000000; text-align: center; font: 62.5%/1.5 "Lucida Grande", "Lucida Sans", Tahoma, Verdana, sans-serif; } site_container { background-color: #FFFFFF; height: 100%; margin-left: auto; margin-right: auto; text-align: left; width: 100%; } /* Some style sheet includes / / @import "/css/site_header.css"; */ /* Default Font Sizes */ h1 { font-size: 2.2em; } h2 { font-size: 2.0em; } h3 { font-size: 1.8em; } h4 { font-size: 1.6em; } h5 { font-size: 1.4em; } p { font-size: 1.2em; } /* Default Form Layout */ input.text { padding: 3px; border: 1px solid #999999; } /* Default Table Reset */ table { border-spacing: 0; border-collapse: collapse; } td{ text-align: left; font-weight: normal; } /* Cause not all browsers know what HTML5 is... */ header { display:block;} footer { display:block;} and now the file: /css/site_header.css: site_header { background-color: #c0c0c0; height: 100px; position: absolute; top: 100px; width: 100%; } Problem: When I use the above code, the site_header div does not have any formatting/background. When I remove the link line from the HTML doc for site_header.css and instead use an @import url("/css/site_header.css"); in my main.css file, the same results -- nothing gets rendered for for the same div. Now when I take the CSS markup from site_header.css and add it to main.css, the div gets rendered fine... So I am wondering if having multiple css files is somehow not working... or maybe having that css markup at the end of my previous css is somehow conflicting, though I cannot find a reason why it would.

    Read the article

  • css nth-child(2n+1) repaint css after filtering out list items

    - by Michael
    I have a list of 20+ items. The background-color changes using the :nth-child(2n+1) selector. (ie. even item black, odd item white). When I click a button to filter out specific items using the jQuery Isotope plugin it adds a .isotope-hidden class to the items I want to filter out, which changes the position of the list item to 0,0 and opacity to 0. When this happens the remaining items are left with the original black/white background-colors, which are now no longer in order. Does anyone know a way to "repaint' the css using the :nth-child(2n+1) selector on the items that do not contain the .isotope-hidden class. I tried #element tr:not(.isotope-hidden):nth-child(2n+1) with no avail. Any help would be appreciated. Thank you.

    Read the article

  • CSS Footer bar bottom center issue

    - by StealthRT
    Hey all, i am trying to get my bottom bar to center on the screen but i am unable to do so. <style type="text/css"> body { background: #fffff; margin: 0; padding: 0; font: 10px normal Verdana, Arial, Helvetica, sans-serif; } * {margin: 0; padding: 0; outline: none;} #bottomBar { position: fixed; bottom: 0px; left: 0px; z-index: 9999; background: #e3e2e2; border: 1px solid #c3c3c3; border-bottom: none; width: 500px; min-width: 500px; margin: 0px auto; -moz-opacity:.90; filter:alpha(opacity=90); opacity:.90; } *html #bottomBar {margin-top: -1px; position: absolute; top:expression(eval(document.compatMode &&document.compatMode=='CSS1Compat') ?documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight));} #bottomBar ul {padding: 0; margin: 0;float: left;width: 100%;list-style: none;border-top: 1px solid #fff;} #bottomBar ul li{padding: 0; margin: 0;float: left;position: relative;} #bottomBar ul li a{padding: 5px;float: left;text-indent: -9999px;height: 16px; width: 16px;text-decoration: none;color: #333;position: relative;} html #bottomBar ul li a:hover{ background-color: #fff; } a.PDF{background: url(http://www.xxx.com/img/pdficon.png) no-repeat center center; } </style> <div id="bottomBar"> <ul id="mainpanel"> <li style="padding-top:5px; font-family:Arial, Helvetica, sans-serif; padding-left: 5px;">First time here? Be sure to check out the "this" button above or download the PDF here -></li> <li><a href="http://www.xxx.com" class="PDF">Download PDF <small>Download PDF</small></a></li> </ul> </div> Thanks! David

    Read the article

  • CSS, Aboslute divs in a relativly positioned div

    - by ace
    Given the following code, how can I make the height of wrapper div extend all the way down. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> <style type="text/css"> .wrapperDiv { position: relative; width: 800px; background-color: #FFFF00; margin-right: auto; margin-left: auto; } .content { position: absolute; width: 95%; top: 55px; background-color: #008000; } .footer { position: absolute; width: 95%; height: 50px; background-color: #FF00FF; bottom: 5px; } .header { position: absolute; width: 95%; height: 50px; background-color: #CCFF33; top: 5px; } </style> </head> <body> <div id="wrapper" class="wrapperDiv"> <div id="layer2" class="footer"> 3</div> <div id="layer3" class="header"> 1</div> <div id="layer1" class="content"> 2<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> END</div> </div> </body> </html>

    Read the article

  • How * tag can be used in CSS?

    - by php html
    I'm trying to understand how a background image is used in a css button. It seems the image is much larger than the button, still the corners are matched to the button(resulting a rounded corner button). It seems it is related to .btn *. I couldn't find any reference about how * can be used. Can you explain how the image is rendered in the button, using the * tag? I assume * will match any element. However I don't get it how in this case the image is rendered like this. .btn { display: block; position: relative; background: #aaa; padding: 5px; float: left; color: #fff; text-decoration: none; cursor: pointer; } .btn * { font-style: normal; background-image: url(btn2.png); background-repeat: no-repeat; display: block; position: relative; } full example here: http://monc.se/kitchen/59/scalable-css-buttons-using-png-and-background-colors/

    Read the article

  • Mimicking a HBox / VBox with CSS

    - by Daniel Hai
    I'm an old school tables guy, and am pretty baffled when it comes to modern HTML. I'm trying to something as simple as vertical / horizontal layouts (i.e. Flex's hbox/vbox), but am having major difficulty replicating them. An old table would look something like this for an HBox: <table width="100%" height="100"> <tr valign="middle"> <td nowrap style="background-color:#CCC">I am text on grey</td> <td width="50%" valign="top">displays top</td> <td width="50%" align="right">Autosize Fill (displays bottom right)</td> </tr> </table> Now I'm trying to do this with div's, but to no avail. When using display:inline, I cannot set a percentage width -- it only takes explicit widths. When using float:left, settings 100% percentage width causes it to really be 100% and pushes the next div down. Here's the code I've been playing with: <html> <head> </head> <style type="text/css"> div.test { background-color: #EE9; padding:5px;} body { font-family: Arial; } ul { list-style-type:none; } ul li { float:left; } .hboxinline div { display: inline; } .hboxfloat div { float:left; } .cellA { background-color:#CCC; width:100%; } .cellB { background-color:#DDD; min-width:100; } .cellC { background-color:#EEE; min-width:200; } </style> <body> A = 100%, b = 100, c = 200 <div class="test">old school table <table cellpadding="0" cellspacing="0"> <tr> <td class="cellA">A</td> <td class="cellB">B</td> <td class="cellC">C</td> </tr> </table></div> <br/> <div class="test"> float:left <div class="hboxinline"> <div class="cellA">A</div> <div class="cellB">B</div> <div class="cellC">C</div> </div> </div> <br/> <div class="test">ul / li <ul class="ulli"> <li class="cellA">A</li> <li class="cellB">B</li> <li class="cellC">C</li> </ul> </div> <br/> <div class="test"> display:inline <div class="hboxfloat"> <div class="cellA">A</div> <div class="cellB">B</div> <div class="cellC">C</div> </div> </div> </body> </html>

    Read the article

  • Aligning data in a table

    - by Hulk
    In the following table, how do I align the data in td cells such that we do not get a horizontal scroll bar, using CSS? <table> <tr><th>name</th> <th>info</th></tr> <tr><td>Harry</td> <td>suminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfo<td></tr> <tr><td>test</td><td>test data</td></tr> </table>

    Read the article

  • Container/Wrapper Div does not contain all content?

    - by Imran
    Container/Wrapper Div does not contain all content (ie all the child Div's).I've tried overflow: hidden but still doesn't work. Can someone please tell me why this is happening and what are the possible solutions. Thank you in advance ;-) for some reason the whole code does not display?? <html> <head> <style type="text/css"> #wrapper { margin:0 auto; width: 600px; background: yellow; } </style> </head> <body> <div id="wrapper"> <div="header"> <h1>my beautiful site</h1> </div> <div id="navigation"> <ul> <li><a href="#">Home </li> <li><a href="#">About</li> <li><a href="#">Services</li> <li><a href="#">Contact us </li> </ul> </div> <div id ="content"> <h2> subheading<h2> <p> long paragraph </p> </div> <div id ="footer"> copyright 123 </div> </div> </body> </html>

    Read the article

  • CSS / HTML centering a textbox

    - by Robert
    This should be easy but its proving difficult... My element I want centred is exactly this <input type="text"> I don't want the text centred, just the text box within the outer div. This is my attempt which is not working <div class ="temp123"> <input type="text" /> </div> Where: .temp123 { margin: 0 auto; margin-left: auto; margin-right: auto; } The text box remains on the left. The outer div has a fixed with of 300px and itself is centered using margin: 0 auto;

    Read the article

  • Getting overflow-y:scroll to work with fixed positioning html & css

    - by Vagabond_King
    I have a Jquery tools scrollable thats set to be fixed to the bottom of the browser window. Ideally i would just like to get a overflow-y:scroll; working for the page as a whole when the browser is < 700px. (so no content gets hidden, as its all fixed place). This feels like it should be simple but its causing me huge headaches. js solutions are fine at this point. Thanks in advance. <body> <div id="background"> <div id="fix_to_floor"> <div class="scrollable"> <div class="frame"> <div class="page" id="page1"> <div class="inner_page"> <h2>About Us</h2> <p>content</p> <div class="floor_items"> <img src="images/chair_n_hole.png" width="950" height="700" alt="Chair N Hole"> </div> </div> </div> <div class="page" id="page2"> <div class="inner_page"> <h2>page 2</h2> <p>content</p> <div class="floor_items"> <img src="images/spachairs.png" width="950" height="700" alt="Spachairs"> </div> </div> </div> <div class="page" id="page3"> <div class="inner_page"> <span class="copy"> <h2>Products</h2> </span> </div> </div> </div> </div> </div> </div> </body> body { width: 100%; bottom:0px; position: fixed; } div#background{ height:948px; width:100%; background: #DDD url('../images/working_bg.jpg') repeat-x fixed bottom center; bottom:0px; overflow: scroll; } div#fix_to_floor{ position: fixed; margin: 0 auto; bottom:0px; height: 700px; width: 1700px; } .content img{ position: absolute; bottom: 0; } #content div.floor_items{ position: absolute; bottom:0; width:1700px; width: 950px; height: 700px; } /* **** specific page backgrounds */ /* page 3 - Products */ #page3 .inner_page{ background: url('../images/display.png') no-repeat scroll bottom center; z-index: 50; } #page3 .copy{ float: left; margin: 100px 300px; } #page1 div.floor_items img{ margin: 0 0 0 0px; } /********* SCROLLABLE *********/ div.scrollable{ bottom: 0; position: relative; /* required*/ overflow:hidden; width:1700px; height: 700px; left:0px; } /* needs to be huge and fixed. holds the content */ div.scrollable div.frame{ width: 20000em; position: absolute; height: 700px; } /* single item , must bve floated for horiz. scrolling*/ div.frame div.page{ float:left; width: 1700px; height: 700px; margin: 0; } div.page div.inner_page{ width:950px; height:700px; margin: 0 370px; /* border: 1px solid red;*/ }

    Read the article

  • CSS Margin/Padding Issue on Browser Zoom

    - by korymath
    I am having difficulty getting my page to show up correctly at various browser zoom settings. http://andstones.ca/newsite The content is aligned if the user is zoomed out on the page, but once they zoom too far out and refresh the page, or if they are too zoomed in and the page loads, then the content pane is shifted. This does not seem to be an issue in firefox, but it is a very serious issue in chrome/safari/iexplore and on the iPad. What can I do to ensure that the main content loads in the correct position regardless of user browser settings? Thanks , Kory

    Read the article

  • flow 2 columns of text automatically with CSS

    - by Joseph Mastey
    I have the code similar to the following: <p>This is paragraph 1. Lorem ipsum ... </p> <p>This is paragraph 2. Lorem ipsum ... </p> <p>This is paragraph 3. Lorem ipsum ... </p> <p>This is paragraph 4. Lorem ipsum ... </p> <p>This is paragraph 5. Lorem ipsum ... </p> <p>This is paragraph 6. Lorem ipsum ... </p> I'd like to, without markup if possible, cause this text to flow into two columns (1-3 on the left, 4-6 on the right). The reason for my hesitation to add a column using a <div> is that this text is entered by the client via a WYSIWYG editor, so any elements I inject are likely to be killed later on inexplicably. Thanks, Joe

    Read the article

  • CSS difficulty horizontally displaying / repeating left and right wrapper images to ends of screen

    - by user310606
    I am having trouble getting my left and right repeaters to fill the available space left on wide screens for a website I am working on. The left and right repeaters are background images (approxamately 350px wide) that I would like to show part of, or even repeat if the screen (visible area of screen shown in red) becomes wide enough. Any help or suggestions would be greatly appreciated! Thanks, John

    Read the article

  • Which combing css technique?

    - by DotnetShadow
    Hi there, Which of the following would you say is the best way to go when combining files for CSS: Say I have a master.css file that is used across all pages on my website (page1.aspx, page2.aspx) Page1.aspx - A specific page that has some unique css that is only ever used on that page, so I create a page1.css and it also uses another css grids.css Page2.aspx - Another specific page that is different from all other pages on the site and is different to page1.aspx, I'll name this page2.aspx and make a page2.css this doesn't use grids.css So would you combine the scripts as: Option1: Combine scripts csshandler.axd?d=master.css,page1.css,grids.css when visiting page1 Combine scripts csshandler.axd?d=master.css,page2.css when visiting page2 Benefits: Page specific, rendering quicker since only selectors for that page need to be matched up no unused selectors Drawback: Multiple combinations of master.css + page specific hence master.css has to be downloaded for each page Option2: Combine all scripts whether a page needs them or not csshandler.axd?d=master.css,page1.css,page2.css,grids.css (master, page1 and page2) that way it gets cached as one. The problem is that rendering maybe slower since it will have to try and match EVERY selector in the css with selectors on the page even the missing ones, so in the case of page2.aspx that doesn't use grids.css the selectors in grids.css will need to be parsed to see if they are in page2 which means rendering will be slow Benefits: One file will ever be downloaded and cached doesn't matter what page you visit Drawback: Unused selectors will need to be parsed by the browser slower rendering Option3: Leave the master file on it's own and only combine other scripts (the benefit of this is because master is used across all pages there is a chance that this is cached so doesn't need to keep on downloading csshandler.axd?d=Master.css csshandler.axd?d=page1.css,grids.css Benefits: master.css file can be cached doesn't matter what page you visit. Not many unused selectors as page spefic is applied Drawback: Initially minimum of 2 HTTP request will have to be made What do you guys think? Cheers DotnetShadow

    Read the article

  • Which combining css technique?

    - by DotnetShadow
    Hi there, Which of the following would you say is the best way to go when combining files for CSS: Say I have a master.css file that is used across all pages on my website (page1.aspx, page2.aspx) Page1.aspx - A specific page that has some unique css that is only ever used on that page, so I create a page1.css and it also uses another css grids.css Page2.aspx - Another specific page that is different from all other pages on the site and is different to page1.aspx, I'll name this page2.aspx and make a page2.css this doesn't use grids.css So would you combine the scripts as: Option1: Combine scripts csshandler.axd?d=master.css,page1.css,grids.css when visiting page1 Combine scripts csshandler.axd?d=master.css,page2.css when visiting page2 Benefits: Page specific, rendering quicker since only selectors for that page need to be matched up no unused selectors Drawback: Multiple combinations of master.css + page specific hence master.css has to be downloaded for each page Option2: Combine all scripts whether a page needs them or not csshandler.axd?d=master.css,page1.css,page2.css,grids.css (master, page1 and page2) that way it gets cached as one. The problem is that rendering maybe slower since it will have to try and match EVERY selector in the css with selectors on the page even the missing ones, so in the case of page2.aspx that doesn't use grids.css the selectors in grids.css will need to be parsed to see if they are in page2 which means rendering will be slow Benefits: One file will ever be downloaded and cached doesn't matter what page you visit Drawback: Unused selectors will need to be parsed by the browser slower rendering Option3: Leave the master file on it's own and only combine other scripts (the benefit of this is because master is used across all pages there is a chance that this is cached so doesn't need to keep on downloading csshandler.axd?d=Master.css csshandler.axd?d=page1.css,grids.css Benefits: master.css file can be cached doesn't matter what page you visit. Not many unused selectors as page spefic is applied Drawback: Initially minimum of 2 HTTP request will have to be made What do you guys think? Cheers DotnetShadow

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >