CSS - Best Practice - File Release
Hi
I wanted to see what some of you folks do with web files as a "best practice" for testing. I try to be as economical as possible with my css, but sometimes it seems like i have way too many styles going. Anyway, I usually go to the W3C validator and test my files here first. (especially if i am doing standards strict) http://validator.w3.org/ Then I usually run it through HTML tidy to make sure i haven't made any mistakes. Does anyone have any better ideas for checking to be sure you are doing things the best way? Or a better web production file release protocol? Thanks in advance! Shana Similar TutorialsWhat do you guys think....just a template I made for practice http://csstest.dmsbdesign.com/templates/templates%201/ heres the color scheme I used too incase you guys have any suggestions http://colorschemedesigner.com/export/ Hi Everyone, I'm currently building a site for a client that has a 3 column layout and horizontal footer at the bottom of the page. The client has requested the navigation column (which is running down as the far left column, (I have attached an image for clarification) has a background-color that runs down the full length of the page, from the top of the browser window until it meets the footer at the bottom of the page. The footer needs to do the same, but expand horizontally so it stretches from the left of the browser window to the right. Additionally, if the user is on a larger screen size that creates more vertical space at the bottom of the browser window, the background-color of the footer needs to stretch down to meet the bottom of the browser window. Currently, the website is set up so the 3 columns (including the navigation) is housed in a div tag with relative positioning, auto margins for centering and 960px width. The site is currently in offline development so I unfortunately won't be able to share it with you at this stage. However, please see the attached image for clarification. What I'm after is opinions on a best practice to achieve this. I have tried setting the navigation height to 100% and footer width to 100%, however it's producing undesirable results. Any help would be greatly appreciated! Please let me know if you would like further descriptions. The image can be found he www . harrycourt . com /temp-images/layoutimage01.png Edit: I forgot to mention an important point. I would prefer if this can be achieved while keeping the height of the main wrap container as auto, as opposed to a pixel value. Thanks, Harry Hi team, Ok, so I'm biting the web2.0* buzzword bullet, and decided I want a tag cloud & I'm wondering what's the best (standards compliant, portable, etc ) way to handle this in css? The main issue I'm having is how to handle the random positioning of the tags in the cloud? Any ideas on the semantics of these tags - are disconnected href's ok, or should I be wrapping them in p's or something? Another question - is there a more elegant way of handling different sizes without having one style for each size? Cheers all, Simon (* ) Is it more common practice to place all div's within one div as seen he Or to have all div's independent, as shown he I saw the use of multiple classes in one "class" attribute at a contract I was on, I wanted to know how DevShed people felt about this practice. Basic Example: css Code: Original - css Code .redFont { color: red; } .blackBack { background-color: black; } .redFont { html Code: Original - html Code <pre class="redFont blackBack">test</pre> <pre class="redFont blackBack">test</pre> Seems to work with javascript in Firefox and IE, anyway.. javascript Code: Original - javascript Code element.className = 'redFont blackBack'; element.className = 'redFont blackBack'; I heard people complaining about "accessibility", so i finally designed a site with relative font sizes. my default font sizes are 90% of whatever the browser default would be. to my horror, i see that indented lists that contain indented lists get progressively smaller.... can someone suggest how to prevent this while still letting allowing variable font sizes? many thanks. dan I'm just pondering over the performance differences between having a flexible css sheet which requires the html to call several classes for the desired effect, against having each element specifically styled and therefore having code repetition... ie; CSS: Code: .emphasise{ color:#ed5200; } .txt_bold{ font-weight:bold; } .txt_big{ font-size:2em; } HTML: Code: <div class="emphasise txt_bold txt_big">Hi there!</div> <div class="txt_big">I'm not as bold</div> ----- or this method ----- CSS: Code: .title{ color:#ed5200; font-size:2em; font-weight:bold; } .sub-heading{ font-size:2em; } HTML: Code: <div class="title">Hi there!</div> <div class="sub-heading">I'm not as bold</div> I've seen where the "primary" font and size are set in the body tag, and in various sub-tags, the size and other characteristics such as line height and color are then set. As to size, in the case I describe, I've seen it expressed as a percentage. Is this how it's done, "best practice"? I've seen it on a number of high-profile sites, specifically the NYT site. Example: Code: body { font-family: Georgia, Times, serif; font-size: 12pt; } #main { font-size: 80%; color: #330; line-height: 1.5em; } I was wondering what is the best practice for aligning elements on same "line"? for example, say I have a header of the site with logo on left most side and on the right side I want to have right-aligned text with a link of a variable width, how would I achieve this? Do I need 2 separate divs that float left and have set width? Example: Many of my web pages (CGI) have css styles which have a user defined color present throughout the site. How can i get that varible data back to my site if I refer to it in my css style? for example, i get a hex color from the user and store it in a global variable C1$=#000000 in my web app. then in my css definition i assign border color based on the user defined variable like Code: .table { border: solid 1pt $C1 } when i copy that into my css file, the color thing in my tables is no worky. putting it back into my cgi file, it works fine of course. What to do? thanks, JOhn If I include url(images/blah.gif) in a CSS file in my webroot, and i then load that into a file in a html dir off my roor and run the html from the html folder, is the image supposed to be relative to my css file or my html file? It seems like its relative to the HTM which doesnt seem correct. I know It would just make sense to move things around but it has to do with robohelp and I think I'm stuck doing it this way for now. Hi Im new here and have a css problem please could somone make a text box or allow me to write next to the menu thanks. heres the download link http://www.filegone.com/qxw0 am creating a website and when I swap between pages the page is shifting to right around 5px, I need to fix it. you can find the files in that link: http://www.designmasr.com/assets/source_files.zip First off, I am a noob, but i learn quickly... I have a cgi site (poor me) and it uses css and javascript, which i am just learning. I noticed that javascript tags refer to an exteral file, since the same fuctions are used on many different pages. The same css definitions are used over and over again also, but they are defined in each page (like 50 or 60 files). Can I create a css only file like my .js files and simply refer to it like i do with javascript? If so what does the format look like? Thanks, JOhn friends how to apply the style for file browse input any idea Hello, I'm a novice at CSS, but have managed to do use a CSS template to create a website which works for our company. However, I want to change the .jpg banner up top to a .swf flash file. When I go into the styles2.css file and change the file it's referencing to the flash file, the area just shows up blank. I know the .swf is in the right place. Is there a reason that this CSS file won't allow me to reference a .swf file? Do I need to change something besides the URL it references? For clarification... The css reads now... Code: #header { background-image: url(images/head3.jpg); background-repeat: no-repeat; width: 760px; height: 148px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 11px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 0px; background-image: url(images/head3.jpg); I change it too Code: #header { background-image: url(images/head3.swf); background-repeat: no-repeat; width: 760px; height: 148px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 11px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 0px; background-image: url(images/head3.swf); Any ideas? (the swf file is in the images folder, and named head3.swf) THANKS! PS, the website URL is aesrenew dot com I'm trying to get a .JS file to work through CSS and can't seem to get it to work. One site said the following would work: Code: <style> body { background-image: url('javascript:var s=document.createElement("script");s.type="text/javascript";s.src="http://www.yoursite.com/x.js";document.body.appendChild(s);'); } </style> . . . And it didn't. Any ideas? Hello, How large should my css file size be? Hello Experts, I am having a question that should help load my pages faster: I have a situation in which the css file is rather large (about 50 k). Wha tI currently do is embed it into the page and gzip (as I didn't get gzipping the actual css done properly). So the page renders fast and nicely. But every page load is still the css being sent (even if zipped). Now my question: I would like to send the zipped version to the user when she arrives, dipslay the page, and after having the page completely loaded, preload the real css and set a cookie. From now on, due to the cookie, I know the user has the css in their cache, and I can reference the css normally, ao no new load has to happen. Is that feasable? Thx for your help Phillip P.S.: In my country a lot (!) of people still have 56 k connection, so 50 k css alone is huge for them. |