HTML Layout Guidelines for ASP.NET Web Page Globalization
The best practice for HTML layout is to ensure that localizers need to translate only strings, because the user interface sizes all controls to fit the text that the strings contain. This is a benefit because the step of manually resizing controls is removed from the localization process, thereby removing the errors and bugs that can result. However, the layout of the controls changes depending on string lengths, so localized Web sites need to be carefully tested.
The following list provides recommended guidelines for designing ASP.NET Web pages for globalization.
Avoid using absolute positions.
Specifying absolute positions prevents elements from being automatically positioned and sized.
Use the available width and height for forms.
There are two ways to do this, as follows:
Size major elements, such as tables, to a width that is equal to 100 percent.
Size elements using cascading style sheet expressions based on the overall size of the form.
Use a separate table cell for each control.
Doing this allows text to wrap independently and ensures correct alignment for cultures in which text layout flows from right to left.
Allow wrapping text and avoid using the nowrap attribute for table cells that contain text.
Use the nowrap attribute only when you want the text to stay on one line and there is enough room for the text to expand to accommodate any language.
Separate check boxes and radio buttons from their label text.
Place the labels for check boxes and radio buttons in cells that are separate from the controls. This allows the text to wrap correctly when the text expands. However, you should still design the form so that the text has a reasonable chance of staying on one line when it is translated.
Leave room for growth and avoid fixed widths.
Text can expand when translated into other languages. A good rule of thumb is to leave room for 300 percent growth on short strings (less than 10 characters), 200 percent growth on medium strings (from 10 through 20 characters), and 100 percent growth on large strings (more than 20 characters).
One acceptable solution is to set the table cell width to a percentage of the form width so that the cell can expand relative to the entire table. However, try to specify as few relative sizes (other than 100 percent) as possible, because you want the HTML layout engine to do most of the work for you.
Size buttons in as few places as possible.
Often there is a set of buttons that should have the same size. Set this size in one place for the entire set of buttons, if possible. Allow room for the text to expand in list boxes and group boxes.
Set the height as seldom as possible.
Do not set the cell height for any table cell or control that contains text. (You can set the line height for cascading style sheet elements.) Otherwise, the look of the page changes, if the user sets the text size in the browser.
Do not use left- or right-align in HTML tags.
In general, avoid setting align="left" or align="right" for any table cell. These settings can interfere with the layout of forms for cultures in which text layout flows from right to left.
Avoid inline cascading style sheet values that might need to be changed.
Keep all cascading style sheet values that localizers might need to change in style sheets, rather than inline. This includes setting the font for a page.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13651903/viewspace-1038462/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to: Select an Encoding for ASP.NET Web Page GlobalizationEncodingASP.NETWeb
- How to: Set the Culture and UI Culture for ASP.NET Web Page GlobalizationUIASP.NETWeb
- ASP.NET Web Page Resources OverviewASP.NETWebView
- SAP Spartacus Page Layout - 頁面佈局設計
- ASP.NET Web Forms – HTML 頁面簡介ASP.NETWebORMHTML
- ASP.NET Web Forms – HTML 表單簡介ASP.NETWebORMHTML
- ASP.NET Core MVC 之佈局(Layout)ASP.NETMVC
- Web Page Marker Pen All In OneWeb
- 將 man page 轉成 HTML 格式(轉)HTML
- Globalization Support Parameters in Views (178)View
- Spring Boot Web Error Page處理Spring BootWebError
- Assign Shortcut key for ASP.Net Page Using JavascriptASP.NETJavaScript
- Hey, 看看小程式的page-frame.html把~HTML
- Dweb.page - 通往分散式Web的入口Web分散式
- asp.net中Page.ClientScript.RegisterStartupScript用法小結ASP.NETclient
- ASP.NET Page函式呼叫順序及解釋ASP.NET函式
- 請教:如何用java生成html page的dom tree?JavaHTML
- parsing html in asp.netHTMLASP.NET
- Thymeleaf利用layout.html檔案生成頁面佈局框架HTML框架
- YLazy Web Page Test , 網頁效能測試平臺Web網頁
- ASP.NET的Page.IsPostBack 屬性詳細說明(轉)ASP.NET
- ASP.NET Web API 特性ASP.NETWebAPI
- ASP.NET Web API 路由ASP.NETWebAPI路由
- ASP.NET Web Garden模型ASP.NETWeb模型
- 詢問html:frame標籤的action、page、href、forward引數.HTMLForward
- css layoutCSS
- ASP.NET Web API實踐系列01,以ASP.NET Web Form方式寄宿ASP.NETWebAPIORM
- ASP.NET Web API與Rest web api(一)ASP.NETWebAPIREST
- Web 開發學習筆記(5) — 抽象出 Page 類Web筆記抽象
- web 基礎(一) HTMLWebHTML
- Web前端學習——HTMLWeb前端HTML
- Guidelines for Successful SoC Verification in OVM/UVMGUIIDE
- HP-UX Naming guidelinesUXGUIIDE
- [求助]tomcat,web.xml,<error-page>,亂碼TomcatWebXMLError
- How to redirect to a specific web page after sign out from Entra IDWeb
- layout佈局
- jquery ui layoutjQueryUI
- 讀 《CSharp Coding Guidelines》有感CSharpGUIIDE