Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi ,

how can i set browser in .net. i have developed a website resently.when i check i different browsers the alignment is changing. what can i do to set this problem
Posted

Use % for width instead of px.
like
HTML
<div style="Width:50%"></div>
 
Share this answer
 
v2
Comments
yerrojumeher 20-Oct-11 6:38am    
should i use it every where in asp.net like for table td or tr or only for div tags
BobJanova 20-Oct-11 7:01am    
This won't solve the problem. All browsers are capable of rendering both fixed and percentage width elements.
Getting websites to look exactly the same in all browsers is difficult. (In particular, Microsoft screw up various CSS layout properties, like min-width, margin/padding etc, so to get a page to look right in IE requires hackery.) What you should be worried about is the site looking good in all (major) browsers.

That can be a matter of staying away from the problem attributes/style properties, using some of the CSS tricks to fool different browsers into parsing different bits of your stylesheet, detecting the browser server-side and emitting different style information, or simply accepting that some items will move a bit and using relative positions so that things are in the right place within their local context.

Searching for browser compatibility CSS should get you some useful information on how to make layout work as close to the same as possible.
 
Share this answer
 
 
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