Login | Register | FAQ
Anonymous

h1 style affecting jAlert implementation

+ Post a reply

6 posts Page 1 of 1


h1 style affecting jAlert implementation

by jessedotnet » Fri Jun 22, 2012 5:41 pm

When I change the height and width of h1 in an external style sheet it screws up my implementation of jAlert. Is this poor css practice? Thanks for any suggestions.
Here is my style sheet named teststyle.css:

h1 {
height: 120px;
width: 700px;
}

here is my html document if you are interested:

<html>
<head>
<title>Tester</title>
<link rel="stylesheet" type="text/css" href="teststyle.css" />
<script type="text/javascript" src="latestjquery.js"></script>
<script type="text/javascript" src="jquery.alerts.js"></script>
<link href="jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
</head>

<body>
<div>
<p><input type="submit" value="Click to get jAlert" onclick="validate()" /></p>
</div>
<script type="text/javascript">
function validate(){$(document).ready(function(){
jAlert('here is alert','Test title');});
}
</script>
</body>
</html>
User avatar

jessedotnet

  • Posts: 20
  • Joined: Thu Jun 07, 2012 7:04 pm

Re: h1 style affecting jAlert implementation

by XainPro » Sat Jun 23, 2012 10:59 am

you should use class or id if you want to style specific element h1 will generally style all h1 element in the document.
User avatar

XainPro

  • Posts: 3567
  • Joined: Fri Feb 17, 2012 8:10 pm

h1 style affecting jAlert

by jessedotnet » Sun Jun 24, 2012 12:35 am

thanks for the response. I do wish to modify all h1 elements in the document as well as other documents. I stripped down one of the documents to isolate the issue for purposes of exposition. What I don't understand is why changes to h1 affect the appearance of the jAlert box. I suspect that it is poor practice to modify the height or width of h1. thanks again.
User avatar

jessedotnet

  • Posts: 20
  • Joined: Thu Jun 07, 2012 7:04 pm

Re: h1 style affecting jAlert implementation

by XainPro » Sun Jun 24, 2012 8:43 am

yah I THINK it is poor practice to modify the height or width of h1 you should use font-size etc because heading is a text not the box.
in jalert maybe they use h1 somewhere that's why its becoming the problem because you have given too big height or width try removing height and width properties from your h1 style and add font-size.
User avatar

XainPro

  • Posts: 3567
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: h1 style affecting jAlert implementation

by jessedotnet » Sun Jun 24, 2012 8:52 pm

You were right. I removed height and width from h1 and put the headings inside a div of same dimensions. the effect is the same and jAlert works fine now. thanks for all your help XainPro, with respect to this as well as my previous post.
User avatar

jessedotnet

  • Posts: 20
  • Joined: Thu Jun 07, 2012 7:04 pm

Re: h1 style affecting jAlert implementation

by XainPro » Mon Jun 25, 2012 5:36 am

My pleasure :)
User avatar

XainPro

  • Posts: 3567
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1

?>