Coding questions

Yup, I think it should be a label. Haven't actually put it as one though, my bad.

I take it I need to style a few different text elements seperately, labels, p, etc.?

Cheers :cheers:

As an example of the kind of thing I'm doing:
http://www.w3schools.com/html/html_forms.asp

Under 'The Form's Action Attribute and the Submit Button'
 
Well if you just start out by styling the biggest part (<p>, <li>)of your text in your body tag, then you only need to style your special elements such as headings.
 
Yeah mate. If you look under the 'type' section of my CSS you'll see a vast array.

Also check the text module: http://learningforlife.fsu.edu/webmaster/references/xhtml/tags/

The eg from your page btw:
Code:
<form>First name:<input type="text" name="firstname" /><br />Last name:<input type="text" name="lastname" /></form>

should be

Code:
<form><div><label for="firstname">First name:</label><input type="text" name="firstname" id="firstname" /></div><div><label for="lastname">Last name:</label><input type="text" name="lastname" id="lastname" /></div></form>
 
Harry said:
Yeah mate. If you look under the 'type' section of my CSS you'll see a vast array.


The eg from your page btw:
Code:
<form>First name:<input type="text" name="firstname" /><br />Last name:<input type="text" name="lastname" /></form>
should be

Code:
<form><div><label for="firstname">First name:</label><input type="text" name="firstname" id="firstname" /></div><div><label for="[COLOR=Red][B]last[/B][/COLOR][B][COLOR=Red]name[/COLOR][/B]">Last name:</label><input type="text" name="lastname" id="lastname" /></div></form>
Minor error, thought I'd fix it :)
 
Cheers fella, I just copied and pasted each label but forgot to change the for attr.
 
Any reason why you put the label and the input together in a div? Is it best to group them, or is it not really necessary?
 
Well you don't have to, but it means that you can keep them in pairs and use the wrapping div to space them apart etc. There's a debate about the corrent things to use. I use(d to use) p tags, some use divs, some even use ul/lis!
 
Another question, more out of curiosity but it would come in handy:

Can you have nested CSS elements?

As such:

Code:
#id { { background-color:#151F5B; } p { color:#FFF; } }
This seems to suggest so, but trying to implement that style doesn't work out well.
Nested CSS Blocks Out of Hanwell

Edit: Or should it be?:

Code:
#id { * { background-color:#151F5B; } p { color:#FFF; } }
 
Cheers bluecube. Not sure what that other article was about then, it suggested nesting elements in CSS was possible.
 
##DELETED##


Oops, I haven't a clue what you mean.


Unless you mean:

Code:
#content{     styles:here;}     #content p{          styles:here;     }#sub-content{     styles:here;}

IE Indenting selectors as they're indented (cascaded) in the HTML.
 
Nah not quite Harry.

Basically, if you had a div with the id "id".

You'd call it in the code as such:

.id { }

If you wanted to call the paragraphs in the id, you'd do as such:

.id p { }

and if you wanted to call unordered lists in the id you would do as such:

.id ul { }

But to make it easier, surely you could nest the statements as such:

.id { p { } ul { } }

Or something similar. That site suggested it was possible, but it seems it's not.
 
Does anyone know the code to put in the header that tells Google that you've got 2 sites both displaying the same thing, for SEO purposes?
 
One quick question, there seems to be quite a few ways to do a redirect, what's the best way to do a 301 redirect from a .co.uk domain to a .com?

:cheers:

EDIT: Is it just shoving this in .htaccess and deleting the rest of the files off the server?

redirectMatch 301 ^(.*)$ http://www.domain.co.uk
redirectMatch permanent ^(.*)$ http://www.domain.com
 
Back
Top