• Web Development Questions That Don't Need Their Own Thread v2
    3,079 replies, posted
An external .css file. For one, if it's used on many pages the edits get applied on each when you edit the file, plus it keeps the source code of the page clean.
[QUOTE=terrance;32391029]Is it better to use a .css file and an .html file, or stick your css in style tags within the .html file? And why?[/QUOTE] It is best to use an external style sheet when your website consists of more than one page, so that when you want to change your design, you only have to change one file instead of every page your website consists of. Also makes your code look cleaner.
[QUOTE=Dragory;32391066]An external .css file. For one, if it's used on many pages the edits get applied on each when you edit the file, plus it keeps the source code of the page clean.[/QUOTE] [QUOTE=mobrockers2;32391069]It is best to use an external style sheet when your website consists of more than one page, so that when you want to change your design, you only have to change one file instead of every page your website consists of. Also makes your code look cleaner.[/QUOTE] Thank you for the help and info guys.
[QUOTE=terrance;32391115]Thank you for the help and info guys.[/QUOTE] When you make a one-page website I suppose it is alright to put the css in the html, but I would never ever use inline css (I think it's called inline if you do <div font=""> etc?).
Inline is when you use the style attribute with an element (e.g. <div style="color: #ffffff;">Blah</div>). The attributes "font", "color", et cetera are, as far as I know, deprecated (e.g. <div font="Arial">Blah</div>).
[QUOTE=Dragory;32391152]Inline is when you use the style attribute with an element (e.g. <div style="color: #ffffff;">Blah</div>). The attributes "font", "color", et cetera are, as far as I know, deprecated (e.g. <div font="Arial">Blah</div>).[/QUOTE] Right, didn't know they ere deprecated as I never used them :v:
is it ok to use @import or should i just link it from html?
[QUOTE=zzlawlzz;32391254]is it ok to use @import or should i just link it from html?[/QUOTE] I wouldn't use @import unless I wanted to exclude the file from older browsers.
[QUOTE=Dragory;32391278]I wouldn't use @import unless I wanted to exclude the file from older browsers.[/QUOTE] I wonder if that's why my fonts wouldnt work on some firefox.
[QUOTE=zzlawlzz;32391254]is it ok to use @import or should i just link it from html?[/QUOTE] I'm not sure what @import is but I just use <link href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css" rel="stylesheet" type="text/css"> [i]Because some web browsers on some OS's do strange things with my designs, this resets the default CSS I think[/i] <link href="style.css" rel="stylesheet" type="text/css" > [i]And the link to the css I want to use[/i]
[QUOTE=mobrockers2;32391288][i]Because some web browsers on some OS's do strange things with my designs, this resets the default CSS I think[/i][/QUOTE] More clearly, that removes the browser's default values for certain properties, which is a good thing to do, due to differences in the default values between browsers.
There shouldn't be any difference in behaviour between them (although I have heard differently, but I can't find anything to back that up), but using <link> does let you name them (And by doing that, and providing alternate versions, browsers will let you switch between them) On my first site, I had all the layout in the main file, and all the colours and such in another file, so if I added another colour scheme I could provide the ability for end users to change it on the fly.
[QUOTE=mobrockers2;32391288]I'm not sure what @import is but I just use <link href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css" rel="stylesheet" type="text/css"> [i]Because some web browsers on some OS's do strange things with my designs, this resets the default CSS I think[/i] <link href="style.css" rel="stylesheet" type="text/css" > [i]And the link to the css I want to use[/i][/QUOTE] I would think you would google it before answering. [editline]20th September 2011[/editline] using IE10 :D [editline]20th September 2011[/editline] now i am
[QUOTE=zzlawlzz;32391355]I would think you would google it before answering.[/QUOTE] I did, but as I have no idea what it is I, and there are a couple bazillion different meanings and websites about import, I could not find what it meant in this case. You don't have to be such a bitch to me simply because you never thought to validate your html and wrongly used id tags in your designs.
[QUOTE=TheDecryptor;32391310]There shouldn't be any difference in behaviour between them (although I have heard differently, but I can't find anything to back that up), but using <link> does let you name them (And by doing that, and providing alternate versions, browsers will let you switch between them) On my first site, I had all the layout in the main file, and all the colours and such in another file, so if I added another colour scheme I could provide the ability for end users to change it on the fly.[/QUOTE] There are plenty of differences in terms of margins, padding and borders. Look at how Chrome adds a yellow/orange outline around active form elements, for example. Reset stylesheets are really useful, or just add a reset block to your own stylesheet at the top.
[QUOTE=iamacyborg;32391437]There are plenty of differences in terms of margins, padding and borders. Look at how Chrome adds a yellow/orange outline around active form elements, for example. Reset stylesheets are really useful, or just add a reset block to your own stylesheet at the top.[/QUOTE] Firefox put a blue 2px border around my header and I was like wtf for two days untill someone on fp told me to use a reset style sheet :v:
[QUOTE=iamacyborg;32391437]There are plenty of differences in terms of margins, padding and borders. Look at how Chrome adds a yellow/orange outline around active form elements, for example. Reset stylesheets are really useful, or just add a reset block to your own stylesheet at the top.[/QUOTE] I meant between @import and <link>, I didn't refresh before posting.
[QUOTE=TheDecryptor;32391502]I meant between @import and <link>, I didn't refresh before posting.[/QUOTE] @import isn't reliable on certain browsers (I believe a couple of versions of IE might in some situations load imports in the wrong order), and you throw concurrent requests out the window, since you can't start loading the @imported files until the file that does the importing is done. I'd recommend everyone stay away from using @import, and it has become the industry standard to do just that. [editline]20th September 2011[/editline] [QUOTE=terrance;32391029]Is it better to use a .css file and an .html file, or stick your css in style tags within the .html file? And why?[/QUOTE] Split them. It's easier to manage, decouples your markup from your styling, and provides better caching options (a change to a file does not invalidate other cached resources that link to it).
What is the [I]best[/I] (Or should I say "correct") way to parse XML data using PHP then have the output view-able on a website? Different tutorials seem to use cURL, simplexml_load_file or file_get_contents. Which (I guess) still give the same result?
Is there anyway to send and receive UDP packets on the client? The only available method I can find is by using Flash, but I'd rather not use that.
[img]http://i.imgur.com/f0otI.png[/img] On IE. Help. HTML [html] <div id='announcements'><img class='ann_close' src='http://zzlawlzz.com/testing/images/icons/cross.png' /> <span class='ann_spacer' /><span class='announcer'>This is for announcements! Not yet noscript compatible. <br>(Just for this announcements)<br>Click on the 'X' to close the box permanently.(Disabled for now) <br/>EXTRA SPACESSSS<br/>EXTRA SPACESSSS<br/>EXTRA SPACESSSS<br/>EXTRA SPACESSSS</span> <div class='announce' /> </div> [/html] CSS: [css] #announcements { float:right; margin:auto; margin-right:75px; width:420px; height:60px; border-top:0; padding-top:10px; } .announce { width:420px; color:#24B200; padding:10px; min-height:60px; background-color:#CCFEBF; border:1px solid #24B200; filter:alpha(opacity=30); opacity:0.3; position:relative; z-index:-1; } .announcer { position:relative; width:400px; word-wrap: break-word; padding-left:10px; margin-top:-5px; max-height:60px; float:left; color:#24B200; overflow: hidden; overflow-y: auto; z-index:100; } .ann_close { position:relative; filter:alpha(opacity=50); opacity:0.5; cursor:pointer; left:10px; top:10px; float:right; z-index:100; } .ann_close:active { filter:alpha(opacity=100); opacity:1.0; } [/css] OH i just added the "I recommend using any other browser except Internet Explorer." just in-case if it's not fixable
What exactly is the problem you're having?
[QUOTE=mobrockers2;32397850]What exactly is the problem you're having?[/QUOTE] I need the green box where the text is at. [url]http://zzlawlzz.com/testing[/url]
[QUOTE=zzlawlzz;32398138]I need the green box where the text is at. [URL]http://zzlawlzz.com/testing[/URL][/QUOTE] I don't have this problem on Chrome, have you tried using a reset style sheet like I explained a few posts back? Might be IE has some funky stuff in their default style sheet.
[QUOTE=mobrockers2;32398249]I don't have this problem on Chrome, have you tried using a reset style sheet like I explained a few posts back? Might be IE has some funky stuff in their default style sheet.[/QUOTE] [QUOTE=zzlawlzz;32397038]On IE. Help.[/QUOTE] I fixed it for other browsers just today (Opera mini :v: not opera). I just can't seem to fix it for IE.
I've been messing around with userscripts for myself and a friend, and I've run into a little bit of an issue. I've created an autoupdate notification system, but firefox caches the userscript. This makes the updates pretty hard, and I've talked to a few people, and no one seems to know how I'd fix this. The only thing I can think of would be doing it through a .htaccess file, but I can't find anything on that. Can anyone here help me with this?
[QUOTE=Anti Christ;32398973]I've been messing around with userscripts for myself and a friend, and I've run into a little bit of an issue. I've created an autoupdate notification system, but firefox caches the userscript. This makes the updates pretty hard, and I've talked to a few people, and no one seems to know how I'd fix this. The only thing I can think of would be doing it through a .htaccess file, but I can't find anything on that. Can anyone here help me with this?[/QUOTE] I have never ever heard of a working autoupdate for userscripts.
[QUOTE=mobrockers2;32399017]I have never ever heard of a working autoupdate for userscripts.[/QUOTE] Well, my method isn't the best by any means, but it gets the job done, since it's just for my friend and myself. I have a variable with the version number defined, and it checks my server for the version I have uploaded. If the version number on my server is greater than the locally installed one, it redirects you to the download, which just pops up with the userscript install window. I'm sure it can be done much better than that, but for now, it's not my priority. [editline]20th September 2011[/editline] Ah well, I found a fix for it. I set it to only cache the file for an hour in the .htaccess file.
So I've recently been getting into web-developement for personal fun, but also I'll be using it at school at some point in IT because I hate Dreamweaver's guts :L My current, first project, website is: [url]www.maxhazell.x10.mx[/url], and it has been completely coded by myself from scratch using nothing but Notepad++ and FireFox (lastest version) to test it I attempted to view the site at school (which only have Internet Explorer on), and found my website to be pretty much screwed up Firefox: [thumb]http://filesmelt.com/dl/FireFox_IE_1.png[/thumb] Internet Explorer: [thumb]http://filesmelt.com/dl/FireFox_IE_2.png[/thumb] Both: [thumb]http://filesmelt.com/dl/FireFox_IE_3.png[/thumb] So as you can see, the div's are no longer centred, the buttons are spassy and well, you can see it all above, so my question is, how do I fix this? You can obviously take a look at the page source and css sheet yourself, but considering I'm still very "nooby" to this (about 1 week in), I have no idea what is wrong
What was that website that gave away awesome free textured tiled backgrounds?
Sorry, you need to Log In to post a reply to this thread.