Putting the CSS Friendly Control Adapters to work
Putting the CSS Friendly Control Adapters to work
Menu Control Horizontal Layout - Asp.net 2.0
Putting the CSS Friendly Control Adapters to work
The CSS Friendly Control Adapters 1.0 override the default HTML generated by the ASP.NET Web controls to provide a more standards-based approach to presentation via CSS. I will show you how to use the Menu control in your ASP.NET applications. I begin with an examination of setting up the environment for using the CSS Friendly Control Adapters in your applications.
The environment
Last week, I outlined two approaches to using the CSS Friendly Control Adapters in your code: downloading the assembly or full source code. This week, I focus on using the full source code. Once you download and install the source code on your system, you should follow these steps to use the features of the CSS Friendly Control Adapters in your application:
|> Create these subfolders in your application's root folder if they do not exist: App_Browsers, App_Code, App_Themes, CSS, and JavaScript.
|> Copy the file named CSSFriendlyAdapters.browser from the App_Browsers folder in the CSS Friendly Control Adapters download to your Web application's App_Browsers folder. This file tells the system to use the control adapters as opposed to the default Web controls. Normally, you wouldn't edit this file since its current settings will work for your Web application, but you can edit it if you need to code for specific browsers. Also, you can remove the browser file to see your site without the CSS Friendly Control Adapters.
|> Copy the entire Adapters folder from the App_Code folder in CSS Friendly Control Adapters download to your Web application's App_Code folder.
|> Copy the entire JavaScript folder from the CSS Friendly Control Adapters download to your Web application.
|> Copy the entire CSS folder (including the BrowserSpecific subfolder) in the CSS Friendly Control Adapters download to your Web applic
Ïà¹ØÎĵµ£º
clip:rect(ÉÏ£¬ÓÒ£¬Ï£¬×ó) Ëĸöµã×ø±ê
<img src="1.jpg" style=" clip:rect(0£¬30£¬10£¬10);"/>
´Ë·½·¨²»ÊʺϼôÇб³¾°
±³¾°Ê¹ÓÃ
style="background-image:url(bg.jpg); background-position:20px 0px;"
kground-position:
1.¶¨Î»·½·¨ left center ºáÏò ×ÝÏò
2.ÇÐÈ¡ ºáÏòpx ×ÝÏòpx
²»ÊʺÏÆ ......
´¹Ö±¾ÓÖжԱí¸ñÀ´ËµÊÇС²ËÒ»µú£¬Ö»ÐèÖ¸¶¨µ¥Ôª¸ñΪvertical-align: middle¼´¿É£¬
µ«ÕâÔÚcss²¼¾ÖÖв»¹ÜÓ᣼ÙÉèÄ㽫һ¸öµ¼º½²Ëµ¥µÄ¸ß¶ÈÉèΪ2em£¬
È»ºóÔÚcssÖÐÖ¸¶¨´¹Ö±¶ÔÆëµÄ¹æÔò£¬ÎÄ×Ö»¹ÊǻᱻÅŵ½ºÐµÄ¶¥²¿£¬¸ù±¾Ã»ÓÐʲôÇø±ð¡£
Òª½â¾öÕâÒ»ÎÊÌ⣬ֻÐ轫ºÐµÄÐиßÉèΪÓëºÐµÄ¸ß¶ÈÏàͬ¼´¿É£¬
ÒÔÕâ¸öÀý×ÓÀ´Ëµ£¬ºÐ¸ß2em,ÄÇôֻР......
1¡¢ÍøÒ³¾ÓÖÐÏÔʾ£º
ÐèÒªÉèÖÃÁ½¸öµØ·½£¬Ò»¸öÊÇbody£¬Ò»¸öÊÇÍâ±ß¿òdiv¡£
CSS£º
body{
margin:0;
padding:0;
text-align:center;
}
#main{ /*×îÍâ²ãDIV*/
width:760px;
margin:0 auto;
padding:0
}
2¡¢ÎÄ×Ö´¹Ö±¾ ......
CSS ¸ÅÊö
CSS Ö¸²ãµþÑùʽ±í (Cascading Style Sheets)
Ñùʽ¶¨ÒåÈçºÎÏÔʾ HTML ÔªËØ
Ñùʽͨ³£´æ´¢ÔÚÑùʽ±íÖÐ
°ÑÑùʽÌí¼Óµ½ HTML 4.0 ÖУ¬ÊÇΪÁ˽â¾öÄÚÈÝÓë±íÏÖ·ÖÀëµÄÎÊÌâ
ÍⲿÑùʽ±í¿ÉÒÔ¼«´óÌá¸ß¹¤×÷ЧÂÊ
ÍⲿÑùʽ±íͨ³£´æ´¢ÔÚ CSS ÎļþÖÐ
¶à¸öÑùʽ¶¨Òå¿É²ãµþΪһ
Ñùʽ½â¾öÁËÒ»¸öÆÕ±éµÄÎÊÌâ
HTML ±êÇ©Ô±¾± ......
ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.clientWidth;
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.clientHeight;
ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.offsetWidth (°üÀ¨±ßÏߵĿí);
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.offsetHeight (°üÀ¨±ßÏߵĿí);
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º document.body.scrollWidth;
ÍøÒ³ÕýÎÄÈ«Îĸߣº document.body. ......