【问题标题】:How to align Grouping Text of only two panels out of many Panels in a page center?如何在页面中心的多个面板中仅对齐两个面板的分组文本?
【发布时间】:2023-03-30 21:13:01
【问题描述】:

在我的页面中有许多面板和分组文本。对于两个面板,分组文本必须居中对齐。我试过了:

legend {
margin:0 auto;

}

<asp:Panel ID="Panel13" runat="server" GroupingText="<b>Grouping Text</b>">
  <table>
     <tr></tr>
  </table>
</asp:Panel>

但它会使所有面板的分组文本居中。我只需要将分组文本中心对齐到两个面板。请帮助我。

【问题讨论】:

  • 使用text-align:center 可能吗?只是猜测,没有你的完整代码很难说。也许可以创建一个小提琴?
  • @indira 如何将自定义样式名称添加到要分组文本中心并应用类的元素,如下所示:.customcss legend {margin:0 auto}
  • @GurtejSingh 代码已更新

标签: css asp.net panel legend fieldset


【解决方案1】:

为您希望文本居中对齐的面板指定特定类别。检查下面的示例。

legend.align-centre {
  text-align: center;
  color: red;
}

legend {
font-size: 16px;
padding: 15px 0;
}
<!DOCTYPE html>
<html>
<head>
	<title></title>

</head>
<body>
  <legend class="align-centre">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type speci</legend>
  
  <legend>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type speci</legend>
  
  <legend>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type speci</legend>
  
  <legend>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type speci</legend>
</body>
</html>

我希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2017-07-13
    • 2012-07-20
    • 1970-01-01
    • 1970-01-01
    • 2013-12-05
    • 2014-07-27
    • 2019-11-28
    • 2015-07-23
    • 2011-07-29
    相关资源
    最近更新 更多