站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
建站程序
开发
服务器
办公软件
开发教程
服务器教程
软件使用教程
运营教程
热门电子书
WordPress教程
宝塔面板教程
CSS教程
Shopify教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Styling Theme Forms
”
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
__TOC__ __TOC__ Every theme for WordPress has at least two forms: '''Search''' and '''Comments'''. If you are [[WordPress:Theme Development|developing a WordPress Theme]] or want to make some adjustments to your Theme's forms, you can customize your forms to match the overall Theme. WordPress的每个主题至少有两个格式:'''搜索''' 和 '''评论'''。如果你正在[[WordPress:Theme Development|开发 WordPress 主题]]或者想要更改主题的形式,你可以自定义形式来匹配这个主题。 ==WordPress Form Styling == ==WordPress 形式设计 == Web Form styling is one of those areas of web page design that is part [[WordPress:CSS]] and part browser influenced. The [http://www.w3.org W3 Consortium] sets standards that say that form elements can be styled, but browsers tend to have their own "opinions." 网络形式设计是网页设计的一个区域,是[[WordPress:CSS|CSS]]的一部分,而且部分受影响的浏览器。[http://www.w3.org W3 Consortium]设置了标准,显示样式元素是可以设计的,但是浏览器倾向与拥有自己的"选项。" We will focus on what WORKS. We will look at what can be done to style forms in WordPress and how to customize your form elements in almost all OS/browser combinations (with the possible exception of Safari/Camino, and, in one case, Opera). 我们会集中于哪个能够运行。我们会看看可以操作什么来设计WordPress样式以及怎样在几乎所有的OS/浏览器结合中自定义你的样式(Safari/Camino,和,在一种情况下,Opera除外)。 [[WordPress:Image:searchform.png|thumb|right|Simple Search Form Example]]While the [[WordPress:Site Architecture 1.5|Comments and Search Forms]] in the Classic and Default Wordpress Themes are similar, we will look specifically at the Default Theme's form, since it is the Theme most WordPress Themes tend to be based upon. [[WordPress:Image:searchform.png|thumb|right|简单的搜索样式例子]]虽然经典和默认WordPress主题中[[WordPress:Site Architecture 1.5|评论和搜索形式]]是相似的,我们会特别查看默认主题的形式,因为默认主题是大多数WordPress主题的根基。 Setting the styles for the specific "form element" will apply that style to ALL the forms within your WordPress site. Since there is the '''search''' and '''comment''' forms, you may want these to look different, so use the style reference ID to specify which element looks like what in which form. 为特别的"形式元素"设置样式,会将这个样式应用到你的WordPress站点内的所有形式中。因为有'''搜索''' 和 '''评论'''形式,你可能想要这些形式看起来不同,因此使用样式reference ID 规定各个形式中的element看起来是怎样的。 Once you have styled your forms, it is time to test them. Check them in as many browsers as possible and be sure to [[WordPress:Validating a Website|validate]] the code. 你一旦设计了自己的形式,就要对其进行测试。在尽可能多个浏览器中浏览这些形式,并且确定[[WordPress:Validating a Website|验证]]了代码。 === Things to Consider === === 需要考虑的内容 === Here are a few other things to consider as you style forms in WordPress. 下面是你设计WordPress中的形式的时候,需要考虑的一些其它的问题。 ;Browser Form Variances :Buttons and other forum elements look different in almost every single OS/browser combination, and the level of control you have styling that button differs just as much between the different OS/browser combinations. For instance, Safari and Camino Mac users will see the same capsule shaped white/gray button, no matter what you define in your CSS. A background color/text color combo that works in almost any other OS/browser does not give you anything but that same white/gray capsule shape with black print in Safari or Camino. The good news is you will always get a workable button even if it looks unattractive. ;浏览器形式变化:按钮和其它论坛元素几乎在每个单独的OS/浏览器结合中看起来都不同,而且你对按钮设计的程度与不同的OS/浏览器结合之间的程度相同。例如,Safari和Camino Mac用户会看到同样的capulse拥有白色的/灰色的按钮,不管你在CSS中定义了什么。几乎在任何OS/浏览器中能够运行的背景色/文本色结合体绝并能使你在Safari或者Camino白色的/灰色的shape加上黑色的字体。幸运地是,你总是能够得到可使用的按钮,虽然这个按钮看起来并不引人注意。 [[WordPress:Image:comment-form-example-too-wide.png|thumb|right|Example of a comment form that is wider than its container]] [[WordPress:Image:comment-form-example-too-wide.png|thumb|right|比container宽的评论形式的例子]] ;Column Width :Forms use input boxes and textareas allowing users to enter information into the forum. These are sized from within the style sheet and in the HTML/XHTML of the [[WordPress:Templates|template files]]. Their width may work without consideration of the width of the parent container. This means that if you are using the search form in your sidebar at a width of 200px and your sidebar's width is set to 150px, you have a problem. Same applies to comment forms. The width of the input boxes and textarea needs to be '''less than the width of the container''' in which it resides. ;栏宽:形式使用输入框和文本区,让用户向论坛输入信息。这些区在样式表内部以及[[WordPress:Templates|模板文件]]的HTML/XHTML中规定了大小。这些区的宽度的制定可能没有考虑到母container的宽度。这意味着,如果你在边栏中使用200px的搜索形式,而你的边栏宽度是150px,你就遇到了麻烦。有的适用于评论形式。输入框和文本区的宽度必须比承载它们的''' container小'''。 ;Padding and Margins :Within many of your form styles, you may add padding and margins to position or create space around the forms. Make sure you add those measurements to your width and compare it with the column width of the container the form sits in. For example, a margin of 5px plus a padding of 10px adds 30px (add both sides!) to the 100px wide input box, bringing it to a total of 130px. Comprae this with the 150px width of the sidebar container, and it will fit. Change the width of the sidebar and that narrow margin of "safety" might be threatened and your layout may turn ugly. ;Padding and Margins :在许多形式样式中,你可能添加在某个地方padding和页面空白或者在形式的周围添加空白。确定将这些添加在你的宽度范围之内,同时将整个宽度与形式位于的container的栏宽对比。例如,5px的margin加上10px的padding将30px(加上两边的!)加到100px的输入框,使得输入框最后为130px。将这个宽度与边栏container150px的宽度相比较,文本框能够适应。更改边栏的宽度,"保险"的狭窄的margin可能会受到影响,而且你的布局可能看起来很糟。 ;Understand the Parent/Child Releationship of CSS :The [[WordPress:CSS_Troubleshooting#The_CSS_Parent_and_Child_Relationship|CSS Parent/Child relationship]] basic states that whatever styles are in the parent container will be passed down to the child container, unless specifically overwritten. For example, if you set your style for the <tt><nowiki><small></nowiki></tt> tag for your entire site, used within the [[WordPress:Post Meta Data Section]], and elsewhere, that style will also be found in the comment form. If you want that particular tag's font size or look to be changed, you need to give it its own style such as <tt>#commentform small</tt>. Or if you want to control the styles for each of the uses of the <tt><nowiki><small></nowiki></tt> tag in your comment form, giving each a unique look, you could use <t>#author small</tt> and <tt>#email small</tt> and so on, overriding the parent styles for that tag. ;了解CSS的母/子关系: [[WordPress:CSS_Troubleshooting#The_CSS_Parent_and_Child_Relationship|CSS 母/子关系]] 基本知识显示不管母container中有什么样式都会传递给子container,除非特别的代替情况。例如,如果你将整个站点的 <tt><nowiki><small></nowiki></tt>标签设计样式,并且用在used within the [[WordPress:Post Meta Data Section|文章Meta Data部分]],在其它位置,样式也是评论形式。如果你想要更改那个特别的字体或者外观,你需要赋予其特别的样式 例如 <tt>#commentform small</tt>。或者你希望控制评论形式中的每个<tt><nowiki><small></nowiki></tt> 标签的样式,使得每个标签拥有独立的外观,你可以使用i <t>#author small</tt> 和<tt>#email small</tt> 等等,取代那个标签的母样式。 <div style="border:blue 1px solid; margin:10px; padding:10px; text-align:center"> '''Before making modifications, backup your WordPress Theme Folder.''' </div> <div style="border:blue 1px solid; margin:10px; padding:10px; text-align:center"> '''在更改任何内容之前,备份年底WordPress主题文件夹。''' </div> ==The Search Form== ==搜索形式== The search form is found within the <tt>searchform.php</tt>. Here is a list of the individual areas of the search form which may be styled by default. You may add style classes to gain more control over the look of your search form. 可以在<tt>searchform.php</tt>中找到搜索形式。下面是搜索形式的每个单个区域的列表,这些区域可能都是默认设置的。你可能添加样式类别,以更好地控制你的搜索形式的外观。 <pre><li id="search"> <label for="s">Search:</label> <form id="searchform" method="get" action="/index.php"> <div> <input type="text" name="s" id="s" size="15" /><br /> <input type="submit" value="Search" /> </div> </form> </li> </pre> <pre><li id="search"> <label for="s">Search:</label> <form id="searchform" method="get" action="/index.php"> <div> <input type="text" name="s" id="s" size="15" /><br /> <input type="submit" value="Search" /> </div> </form> </li> </pre> [[WordPress:Image:Cup-O-Joe-by-callistawolf-searchform.png|left|Cup-o-joe theme search form example]] [[WordPress:Image:Cup-O-Joe-by-callistawolf-searchform.png|left|Cup-o-joe 主题搜索形式例子]] The styles found for the search form are in the <tt>styles.css</tt> style sheet file in your WordPress Theme. The search form itself sits within a [[WordPress:Styling Lists with CSS|list]] in the sidebar. While the form itself begins after the <tt>label</tt>, it is still a part of the form. Depending upon the Theme author's design needs, the search section may or may not include: 搜索形式的样式可以在你的WordPress主题的<tt>styles.css</tt>样式表文件中找到。搜索形式本身位于边栏中的[[WordPress:Styling Lists with CSS|列表]]内。虽然形式本身是在<tt>标签</tt>后开始的,标签仍然是形式的一部分。根据主题作者的设计需求,搜索部分可能或者可能不包含: [[WordPress:Image:journalized-winter-theme-search-form.png|thumb|right|Journalized Winter Theme Search Form Example]] [[WordPress:Image:journalized-winter-theme-search-form.png|thumb|right|Journalized Winter Theme搜索形式例子]] ;<tt>#search</tt> :The overall style for the search form. ;<tt>#search</tt> :搜索表格的整体样式 ;<tt>#search label</tt> :Used to style the <tt>label</tt> tag, if necessary. ;<tt>#search label</tt> :如果必要的话,用来设计<tt>label</tt>标签。 ;<tt>#searchform</tt> :Used to style the form itself. The <tt>#searchform</tt> can be used to define a width for your form, a background [[WordPress:Developing a Colour Scheme|color]] and/or [[WordPress:Using Images|image]], fonts, font sizes, and borders. Setting width for a form can be tricky. If the column that forms <tt>sidebar.php</tt> is a fixed width, then define a width for <tt>searchform</tt> that is just a bit narrower than the column it resides in. And use the dimension type and measurement. If the column is 150px wide, make your <tt>searchform</tt> 146px. If the column width is defined in <tt>em</tt>, use that.<br />Padding and margins can also be added to the <tt>searchform</tt> style, but take care. The measurements are cumulative. If the <tt>searchform</tt> width is 146px, you only have 4px to add margins and padding before you break the width of the sidebar. ;<tt>#searchform</tt> :用来设计搜索表格。<tt>#searchform</tt> 可以用来定义你的表格的宽度,背景 [[WordPress:Developing a Colour Scheme|色]] 和/或者 [[WordPress:Using Images|图像]],字体,字体大小,和边框。为表格设置宽度有点技巧。如果形成<tt>sidebar.php</tt>的栏是定宽, 将<tt>searchform</tt>的宽度定义比<tt>searchform</tt>所处在的栏宽窄一点。并且使用尺寸形式和度量。如果栏是150px宽度,将你的<tt>searchform</tt>设置为 146px。如果栏宽度定义在<tt>em</tt>,使用那个。<br />Padding 和 margins 也可以添加到<tt>searchform</tt> 样式,但是要谨慎。尺寸是积累的。如果<tt>searchform</tt>宽度是 146px,你只有 4px的宽度来添加margins 和padding,这样你才不会破坏边栏的宽度。 ;<tt>#search div</tt> :This unlabeled <tt>div</tt> is a child container of the parent container <tt>search</tt> and may be styled from within that selector.[[WordPress:Image:garden-log-theme-search-form.png|thumb|right|Garden Log Theme Search Form Example]] ;<tt>#search div</tt> :这个没有标记的<tt>div</tt>是母container <tt>search</tt>的子container,而且可能会在那个选择器内部设计。[[WordPress:Image:garden-log-theme-search-form.png|thumb|right|Garden Log 主题搜索形式例子]] ;<tt>#searchform input</tt> :To style the input area for the search, this selector combination will work. There is also another style reference of <tt>#s</tt> that may also be used in addition or as a replacement for this style. It is used to sstyle the background color, font, font-size, and font color, and so on for the input box the user types in. Safari will not recognize background color or (text) color, and will always show the text input box as white with black text. All browsers seem to support font-weight declarations, and all seem to respect font-family. Internet Explorer 5 for the Mac and Safari do not recognize text-align declarations. Font size is best when defined as percentage, though different browsers tend to vary this a little.<br /><br />Padding and margins can be used here, but again, these are dependent upon the browser's interpretation of the measurements. The input box's width is critical to the amount of space the user has to enter their search keywords. It may be defined as a pixel or percentage based width and must "fit" within the width of the sidebar. ;<tt>#searchform input</tt> :要设计搜索的输入区的形式,这个选择符结合体能够运行。也有<tt>#s</tt>的另一个样式参考,可能也会得到使用或者作为替换这个样式。用来设计用户输入内容的输入框的背景色,字体,字体大小,字体颜色,等等。Safari 不会识别背景色或者(文本)色,而且总是显示文本输入框为白色的带有黑色的文本。所有的浏览器似乎都支持font-weight 声明,而且所有的浏览器似乎都考虑到字体集。Mac和Safari的Internet Explorer 5 不能够识别text-align 声明。字体大小定义为百分比的时候,是最好的,虽然不同的浏览器试图不怎么改变这一点。<br /><br />Padding 和margins 可以用在这里,但是,这些要取决于浏览器对度量的解释。输入框的宽度,对于用户可以在搜索关键词区输入多少内容,至关重要。搜索框可能以宽度为基础定义为像素或者百分比,但是搜索框必须"在"边栏宽度的内部。 ;<tt>#searchsubmit</tt> :''Used by the Default Theme'', this selector may be used to style the '''search''' or '''submit''' button. Buttons are where browser support varies the most, though styling a button will always give you a workable button, even if the style is not supported in a particular browser. Here are some tips regarding the various browsers: ;<tt>#searchsubmit</tt> : ''由默认主题使用'',这个选择符可能用来设计'''搜索''' 或者 '''提交'''按钮。按钮是浏览器提供最多的变化的位置,虽然设计按钮可能会向你提供可使用的按钮,即使某个特别的浏览器不支持样式。下面是关于不同的浏览器的一些小贴士: [[WordPress:Image:macosx-safari-search-button.png|frame|right|Safari (OS X) ]] [[WordPress:Image:macosx-firefox-search-button.png|frame|right|Firefox (OS X)]] [[WordPress:Image:macosx-safari-search-button.png|frame|right|Safari (OS X) ]] [[WordPress:Image:macosx-firefox-search-button.png|frame|right|Firefox (OS X)]] * All browsers except Safari and Camino seem to support background-color and (text) color, though the buttons will look very different from browser to browser. *除了Safari和Camino之外,所有的浏览器似乎都支持背景色和(文本)色,但是不同的浏览器中出现的按钮会有所不同。 * Opera changes the button shape if you apply a background color. *如果你应用了背景色,Opera更改了按钮的形状。 * Opera Mac and Win, Safari, and Camino do not support any border styling on buttons. * Opera Mac 和 Win, Safari, 和Camino不支持按钮上的任何边框的样式。 * All browsers except Safari support font-family and font-weight. *除了Safari外,所有的浏览器都支持字体集和font-weight。 * It is recommended that you not define a width on this at all, since it will be as wide as the text that fills the button, no matter what browser-defined font size the user picks. *建议你不要定义这个的宽度,因为这个会与填充按钮的文本宽度相同,不管用户选择的浏览器定义的字体大小是多少。 == The Comments Form == == 评论形式== The '''comments form''' are found within the <tt>comments.php</tt> or <tt>commentspopup.php</tt>. In the Default WordPress Theme, they look like this when viewed as a generated web page: '''评论形式'''可以在<tt>comments.php</tt> 或者<tt>commentspopup.php</tt>内找到。在默认WordPress主题中,作为整个网页访问的时候,评论形式看起来像: <pre><h3 id="comments">One Response to "Hello world!"</h3> <ol class="commentlist"> <li class="alt" id="comment-1"> <cite> <a href="http://example.org/" rel="external nofollow">Mr WordPress</a> </cite> Says:<br /> <small class="commentmetadata"> <a href="#comment-1" title="">Date and Time</a> </small> <p>Hi, this is a comment.</p> </li> </ol> <h3 id="respond">Leave a Reply</h3> <form action="http://example.com/blog/wp-comments-post.php" method="post" id="commentform"> <p> <input name="author" id="author" value="" size="22" tabindex="1" type="text"> <label for="author"> <small>Name (required)</small> </label> </p> <p> <input name="email" id="email" value="" size="22" tabindex="2" type="text"> <label for="email"> <small>Mail (will not be published) required)</small> </label> </p> <p> <input name="url" id="url" value="" size="22" tabindex="3" type="text"> <label for="url"> <small>Website</small> </label> </p> <p> <small><strong>XHTML:</strong> You can use these tags:....</small> </p> <p> <textarea name="comment" id="comment" cols="100" rows="10" tabindex="4"> </textarea> </p> <p> <input name="submit" id="submit" tabindex="5" value="Submit Comment" type="submit"> <input name="comment_post_ID" value="1" type="hidden"> </p> </form> </div></pre> <pre><h3 id="comments">One Response to "Hello world!"</h3> <ol class="commentlist"> <li class="alt" id="comment-1"> <cite> <a href="http://example.org/" rel="external nofollow">Mr WordPress</a> </cite> Says:<br /> <small class="commentmetadata"> <a href="#comment-1" title="">Date and Time</a> </small> <p>Hi, this is a comment.</p> </li> </ol> <h3 id="respond">Leave a Reply</h3> <form action="http://example.com/blog/wp-comments-post.php" method="post" id="commentform"> <p> <input name="author" id="author" value="" size="22" tabindex="1" type="text"> <label for="author"> <small>Name (required)</small> </label> </p> <p> <input name="email" id="email" value="" size="22" tabindex="2" type="text"> <label for="email"> <small>Mail (will not be published) required)</small> </label> </p> <p> <input name="url" id="url" value="" size="22" tabindex="3" type="text"> <label for="url"> <small>Website</small> </label> </p> <p> <small><strong>XHTML:</strong> You can use these tags:....</small> </p> <p> <textarea name="comment" id="comment" cols="100" rows="10" tabindex="4"> </textarea> </p> <p> <input name="submit" id="submit" tabindex="5" value="Submit Comment" type="submit"> <input name="comment_post_ID" value="1" type="hidden"> </p> </form> </div></pre> [[WordPress:Image:mx4-theme-comments-form.png|thumb|right|MX4 Theme Comments Form Example]]While individual sections of the comments feature styling reference, the Default Theme has no general comment division or group style reference, though one could be easily added. [[WordPress:Image:mx4-theme-comments-form.png|thumb|right|MX4 主题评论形式例子]]虽然评论功能样式reference的每个部分是独立的,默认主题没有总的评论部分或者组合的样式reference,但是可以轻易地添加。 The <tt>#commentform</tt> is the wrapper for the whole form, though the styles above it may influence the <tt>#commentform</tt> as part of the [[WordPress:CSS_Troubleshooting#The_CSS_Parent_and_Child_Relationship|CSS parent/child relationship]]. <tt>#commentform</tt>是整个形式的wrapper,但是其上面的样式,作为[[WordPress:CSS_Troubleshooting#The_CSS_Parent_and_Child_Relationship|CSS 母/子关系]]的一部分,可能会影响<tt>#commentform</tt>。 As with the search form, you can style this with either a background color or image, you can add borders, and you can change text color, font-family, font weight, text decoration, etc. You are better off defining width on each of these layout elements. Remember, like the search form, the width of the column in which the comments reside influences the width of the comments. If they are fixed, they may overlap the sidebar. 拥有搜索表格,你可以使用背景色或者图像,设计这个,你可以更改文本颜色,字体类别,字体粗细,文本修饰,等等。你最好在每个布局要素上定义宽度。记住,与搜索表格相似,评论所位于的栏的宽度,会影响评论的宽度。如果这个栏宽度是固定的,可能会与工具栏交迭。 ;h3 #comments:Styles the <tt><h3></tt> tag for the "number of responses to the post" heading. ;h3 #comments: 设计标头为"对文章的评论数目" 的<tt><h3></tt>标签 ;#commentlist ol :Styles the "ordered list" of the comments list. ;#commentlist ol :设计评论列表的"有序列表"。 ;.alt li and #comment-n :The comment list items have two style references. The first one is the class <tt>alt</tt> and the second is the comment ID number signified here by the letter <tt>n</tt>. This allows them to be styled individually or through the use of WordPress Plugins. ;.alt li and #comment-n :评论列表item拥有两个样式reference。第一个是类别<tt>alt</tt>,第二个是评论ID数字,在这里由字母<tt>n</tt>表示。这使得它们能够得到单独的设计或者通过使用WordPress插件。 ;cite :The tag <tt>cite</tt> frames the "Name says:" and link to the comment author's URL. ;cite :标签<tt>cite</tt>制定"名称显示:"并且链接到评论作者的URL。 ;.commentmetadata small :The <tt><small></tt> tag has a class of <tt>commentmetadata</tt> which allows the date and time of the post to be styled. ;.commentmetadata small : <tt><small></tt>标签拥有<tt>commentmetadata</tt>类别,能够使得文章的日期和时间得到显示。 ;ol #commentlist p :Styles the paragraph within the ordered list of comments. ;ol #commentlist p :设计评论的有序列表内的段落。 ;#respond h3 :Styles the heading for "Leave a Reply." ;#respond h3 :设计"留下回复"的标头。 ;#commentform :Style reference for the overall "form" for inputting comments. Each input area has it's own ID. ;#commentform :输入评论的整体"形式"的样式reference。每个输入区拥有自己的ID。 ;#author :ID reference for the comment author's input area. ;#author :评论作者的输入区的ID reference。 ;#comments small :The <tt><small></tt> tag is used in several places in the Classic Theme. This usage surrounds the text in the '''comment submit form''' and the text for the '''list of tags''' that can be used in the comment. ;#comments small :经典主题中有几处都使用了<tt><small></tt>标签。'''评论递交框'''周围的文本的用法和'''标签列表'''的文本可以用在评论中。 ;#email :ID reference for the comment author's email.[[WordPress:Image:impressionist-theme-comment-form.png|thumb|right|Impressionist Theme Comment Form Example]] ;#email :评论作者的电子邮件的ID reference。.[[WordPress:Image:impressionist-theme-comment-form.png|thumb|right|Impressionist 主题评论形式例子]] ;#url :ID reference for the comment author's URL. ;#url :评论作者的URL的ID reference。 ;#comment :ID reference for the comment input textarea. It does not style the final generated comment, just the input box. ;#comment :评论输入文本区的ID referenc。没有设计最后产生的评论,只是设计了文本框。 ;#comment #submit :There are two submit buttons in the Classic Theme, for search and comment submissions. This is the submit comment button. The submit form field is the same type of submit button you styled in the search form. The same issues and rules apply, and the same problems may occur crossbrowser. ;#comment #submit :这是经典主题中的搜索和评论递交的两个递交按钮。这是递交评论按钮。递交表格和你在搜索表格中设计的递交按钮的样式是相同的。同样的问题,应用了同样的原理,而且在浏览器之间可能出现同样的问题。 The number of rows and columns that define the size of the comment textarea box can be set in the [[WordPress:Templates|template files]] <tt>comments.php</tt> or <tt>commentspopup.php</tt>. You can change this here: 可以在[[WordPress:Templates|模板文件]] <tt>comments.php</tt> 或者 <tt>commentspopup.php</tt>中设置定义评论文本框大小的行数和栏数。你也可以在这里更改这个数字: <pre><textarea name="comment" id="comment" cols="100" rows="10" tabindex="4"> </textarea></pre> <pre><textarea name="comment" id="comment" cols="100" rows="10" tabindex="4"> </textarea></pre> ==Other Form Elements == ==其它的形式元素 == === Dropdown Lists === === 下拉列表 === Some WordPress form plugins may require a form with a dropdown box. Dropdown boxes have some styling limits. Two things you need to be aware of: 有的WordPress表格插件,需要表格有个下拉框。下拉框拥有同样的样式限制。你需要注意两点: ;Dropdown Form Width :Styling dropdown box widths, as with text boxes, will be easier if you use the width unit that has been used to define the column in which the dropdown box will reside, so if its a fixed width column defined in pixels, use pixels to define the width of your dropdown box. ;下拉表格宽度:与文本框一样,设计下拉框的宽度,如果你使用下拉框位于的栏中的宽度尺度来定义下拉框的宽度,会更简单,因此如果下拉框是栏中定义的固定像素的宽度,使用像素定义你的下拉框的宽度。 ;Dropdown Form Line Height :To allow the box to stretch in height depending on the browser-defined font size it is best to define a line-height in <tt>em</tt> in your dropdown box. If you do not, the height of the box will remain short no matter how tall the font size. Start with 2em, then experiment in different browsers and with different browser defined font sizes until you're happy with it. ;下拉表格行的高度:根据浏览器定义的字体大小,使得框向上下延伸,最好在下拉框中的<tt>em</tt>定义行高度。如果你没有定义,不管字体有多么高,框的高度仍然非常低。从2em开始,然后尝试其它浏览器,不同的浏览器中显示不同的字体大小,知道你满意这个高度为止。 ===Live Comment Preview === ===即时评论预览 === [[WordPress:Image:comments.png|thumb|right|Comments example using Live Comment Preview Plugin]]When styling your comments, consider adding a Live Comment Preview WordPress Plugin or php script. You can find several plugins on the [http://wordpress.org/extend/plugins/tags/comments Comments Plugins List]. [[WordPress:Image:comments.png|thumb|right|评论例子使用即时的评论预览插件]]设计你的评论的时候,考虑添加即时的评论预览WordPress插件或者php脚本。你可以在[http://wordpress.org/extend/plugins/tags/comments 评论插件列表]上找到几个脚本。 Space to accommodate the live comment preview area needs to be taken into consideration within your comment structure. Some Theme authors add the preview section above or below the comment form. Others make their comment input and textarea boxes narrow and set the preview area to the side or next to the name, email, and URL input boxes. 在评论结构中,需要考虑到承载即时评论预览区的空间。有的主题作者在评论框的上面或者下面添加预览部分。其它作者将评论输入框和文本框设置地很窄而且将预览区设置在旁边,或者在名称,电子邮件,和URL输入框的旁边。 The comment preview styles can also be customized to match your overall theme, so check through the plugin author's documentation to determine which tags and CSS references are used in the plugin. 评论预览样式也可以自定义设置,以匹配你的整体主题,因此通读插件作者的文件,决定在插件中使用哪个标签和CSS references。 == Resources == ==资源 == * [[WordPress:Site Architecture 1.5]] * [http://wordpress.org/extend/plugins/tags/comment WordPress Comment Plugins List] * [http://www.456bereastreet.com/archive/200409/styling_form_controls/ Styling Form Controls] * [http://www.456bereastreet.com/archive/200410/styling_even_more_form_controls/ Styling Even More Form Controls] * [[WordPress:Site Architecture 1.5|站点结构1.5]] * [http://wordpress.org/extend/plugins/tags/comment WordPress 评论插件列表] * [http://www.456bereastreet.com/archive/200409/styling_form_controls/ 样式形式控制] * [http://www.456bereastreet.com/archive/200410/styling_even_more_form_controls/ 设计更多的样式控制]
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)