Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I want to set my span image according to when window is resize.When I resize the window span image is not shown.(Why?)Actually I am using link()and span in it.
My html code is..
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ABC:Main Page</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<style>
a:hover {
	color: #F30;
}
h1 {
	font: bold 150%/120% Arial, Helvetica, sans-serif;
	text-transform: uppercase;
	margin: 0 0 10px;
	color: #0000;
}
a {
	color: #69C;
	text-decoration: none;
}

p {
	margin: 0 0 0px;
}
em {
	font: italic 100% "Times New Roman", Times, serif;
}
.credits {
	border-bottom: solid 1px #eee;
	padding-bottom: 10px;
	margin: 0 0 30px;
}
#pagewrap {
	margin: 0 auto;
	width: 1345px;
	padding-left: 150px;
	position: relative;
}

/*
Back to top button 
*/
#back-top {
	position: fixed;
	bottom: 30px;
	margin-left: -100px;
}
#back-top a {
	width: 40px;
	display: block;
	text-align: center;
	font: 11px/100% Arial, Helvetica, sans-serif;
	text-transform: uppercase;
	text-decoration: none;
	color: #bbb;
	/* background color transition */
	-webkit-transition: 1s;
	-moz-transition: 1s;
	transition: 1s;
}
#back-top a:hover {
	color: #000;
}
/* home icon (span tag) */
#back-top span {
	width: 40px;
	height: 40px;
	display: block;
	margin-bottom: 5px;
	background: #ddd url(up-arrow.png) no-repeat center center;
	/* rounded corners */
	-webkit-border-radius: 15px;
	-moz-border-radius: 15px;
	border-radius: 15px;
	/* background color transition */
	-webkit-transition: 1s;
	-moz-transition: 1s;
	transition: 1s;
}
#back-top a:hover span {
	background-color: #777;
}
</style>

<script type="text/javascript">
$(document).ready(function(){

	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

});

</script>

</head>
<body id="top">
<div id="pagewrap"> 
	<p id="back-top">  
	<a href="#top" style="removed: relative; removed 1230px;"><span></span>Back to top</a>
</p></div>


<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-removed 0.5em;">
   <div id="projectname">ABC
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</body>
</html></div>
Posted
Updated 10-Jan-12 20:02pm
v7

For starters, you don't even have a button element in your html, so it is of no surprise to me that you are not seeing the behavior you expect. You may need to clarify/update your question if you with to get a better answer.
If you are trying to resize an asp:Button or input control, just use a percentage (i.e. '50%') for the width attribute and it will automatically resize when your page does.
 
Share this answer
 
Comments
Member 7909353 11-Jan-12 1:38am    
I am using span in link.
fjdiewornncalwe 11-Jan-12 11:03am    
If you are referring to your span in the link in your pagewrap div, then it may be that your issue arises from your text not being placed in between the span open/close tags, but that is secondary. You can always add a "width: 50%" attribute into the style tag for the anchor element. That will do the same as what I was explaining above.
in css
C#
#back-top {
    position: fixed;
    bottom: 30px;
    right:30px;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900