PDA

View Full Version : CSS not applying?


Jim_Shady
09-05-2005, 01:55 PM
Dear all,

I've got a stylesheet which defines the font as Verdana and the link colours etc. It has worked when applying it to most of my pages - apart from two - and I've no idea why! It apply's everything apart from the font. Which is appearing as Times new Roman?

Any suggestions as to things to check please?

Can paste all the code if necessary...

Shady.

Jim_Shady
09-05-2005, 03:48 PM
I don't think there is anything wrong with my CSS?

#LoginPageHeader{
margin-top: 10px;
background-image:url(../stafflogin.gif);
background-position:center;
background-repeat:no-repeat;
Height: 115px;}
#PageContent{
font: Verdana, Arial, Helvetica, sans-serif;
}
#PageContentLogin{
font: Verdana, Arial, Helvetica, sans-serif;
margin-left: auto;
margin-right: auto;
text-align:center;
}
#LeftTimetableSection{
float:left;
width:200px;
}
#RightTimetableSection{
}
a:link {
color: #0000FF;
text-decoration:none;
}
a:visited {
color: #0000FF;
text-decoration:none;
}
a:hover {
color: #FF0000;
text-decoration:none;
}
a:active {
color: #FF0000;
text-decoration:none;}

Jim_Shady
09-05-2005, 03:59 PM
And this is the page that I am trying unsuccesfully to apply it to.... Relevant bits near the bottom!

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/MScDbase.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="Staff/Staff_My_Courses.asp"
MM_redirectLoginFailed="Staff_login.asp?valid=fals e"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_MScDbase_STRING
MM_rsUser.Source = "SELECT Username, Lecturerpassword"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM Lecturers WHERE Username='" & Replace(MM_valUsername,"'","''") &"' AND Lecturerpassword='" & Replace(Request.Form("Password"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<!-- DW6 -->
<head>
<title>Postgraduate Database Staff Login</title>


<script>

function stb(){document.form1.username.focus();}

</script>

<link href="Templates/DatabaseGeneral.css" rel="stylesheet" type="text/css">
</head>

<Body onLoad=stb() leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<a href="#" onClick="history.go(-1)"></a>
<div id="LoginPageHeader"></div><div id="PageContentLogin">
<form name="form1" method="POST" action="<%=MM_LoginAction%>">
Please enter your login details below:<br><Br>
Username:
<input type="text" name="username" size="25" maxlength="25"><br><br>
Password:
<input type="password" name="Password" size="25" maxlength="25"><br><br>
<input type="submit" name="Login" value="Login">
<br><br>
Request an email <a href="Remind_staff_username.asp">reminder</a> of login details?
</form>
<% IF (Request.Querystring ("valid") = "false") then %>
You either entered an incorrect username or password - please try again
<% End If %>

</div>
</body>
</html>

domedia
09-06-2005, 01:02 PM
Form tags are tricky, make sure you add it to your css rules:
#PageContentLogin, #PageContentLogin form {
font: Verdana, Arial, Helvetica, sans-serif;
margin-left: auto;
margin-right: auto;
text-align:center;
}

Jim_Shady
09-06-2005, 03:44 PM
Figured it out!

I needed to write 'Font-family:' in the CSS instead of just 'Font:'..... bit wierd but seems to have done the trick!

Only slight problem I've not now is that my CSS isn't removing the underline from certain e-mail links.... does with some but not with others. I think it's because they are being pulled from a database perhaps.... suggestions?

Shady

Jim_Shady
09-07-2005, 09:45 AM
Figured it out at last. The link in some of my HTML pages were looking for the CSS document on my local drive. In IE this doesn't seem to be a problem, but firefox won't do this.

Thought I should 'answer' my problem for future reference of others!

Shady.