|
-
Apr 2nd, 2013, 11:21 AM
#1
[RESOLVED] CSS/Html - Attempting CSS
I'm attempting to create a login page using CSS using an external css sheet. Here is my html code:
Code:
<!doctype html>
<html>
<head>
<Title>EMP - Login</title>
<link rel="stylesheet" type="text/css" href="login.css">
</head>
<body>
<h1>Login</h1>
<table id="user_and_pass">
<tr>
<td id="tbl_user">Username:</td>
<td id="tbl_user_txt"><input type="text", name="txt_user"></td>
</tr>
<tr>
<td id="tbl_pass">Password:</td>
<td id="tbl_pass_txt"><input type="text", name="txt_pass"></td>
</tr>
<tr>
<td id="tbl_casing">Passwords are case sensative.</td>
</tr>
<tr>
<td id="tbl_forgot"><a href="">Forgot your password?</a>
<td id="tbl_btn_login"><button name="btn_login">Login</button></td>
</tr>
</table>
<table id="new_user">
<tr>
<td id="tbl_new_acc">Don't have an account?</td>
</tr>
<tr>
<td id="tbl_new_acc_btn"><button name="btn_new_account">Get one now</button></td>
</tr>
<tr>
<td id="tbl_easy">It's easy!</td>
</tr>
</table>
</html>
So far I'm only trying to format some of the td's:
Code:
#tbl_casing td
{
color:grey;
margin-left:30px;
margin-top:20px;
font-size:14px;
}
But the formatting isn't showing up in my page. Am I presenting my css wrong?
-
Apr 2nd, 2013, 01:01 PM
#2
Re: CSS/Html - Attempting CSS
Using #tbl_casing td means the CSS is looking for the td under #tbl_casing.
Since #tbl_casing is the td, it will never style it.
What you could do is either
Code:
#tbl_casing
{
color:grey;
margin-left:30px;
margin-top:20px;
font-size:14px;
}
Or
Code:
td#tbl_casing
{
color:grey;
margin-left:30px;
margin-top:20px;
font-size:14px;
}
The first, would reference any element with the ID of #tbl_casuing, and the second would reference only tds with the ID of #tbl_casing.
Although in these cases, it seems more likely you would want to use a class (.) rather than an ID (#), simply because this seems like something that could be used on multiple elements on the page. An ID should only appear once on a page.
Last edited by kfcSmitty; Apr 2nd, 2013 at 01:06 PM.
-
Apr 2nd, 2013, 01:05 PM
#3
Re: CSS/Html - Attempting CSS
Ahhh awesome. Thanks a lot, and by the way, I'm not so much a fan of your chicken ;]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|