asp.net example - label justify text
label-justify-text.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
<!DOCTYPE html>
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
Label1.CssClass = "LabelJustifyTextStyle";
//another way to apply label justify text.
//Label1.Style.Add("text-align","justify");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
.LabelJustifyTextStyle {
text-align:justify;
}
</style>
<title>asp.net example - label justify text</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
asp.net example - label justify text
</h2>
<hr width="550" align="left" color="Gainsboro" />
<asp:Label
ID="Label1"
runat="server"
Text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's..."
BorderColor="Red"
BorderWidth="1"
Font-Size="X-Large"
Width="350"
>
</asp:Label>
<br /><br /><br />
<asp:Button
ID="Button1"
runat="server"
Text="label justify text"
OnClick="Button1_Click"
Height="40"
Font-Bold="true"
/>
</div>
</form>
</body>
</html>
- How to trim text with ellipsis in a Label
- How to display an image in a Label
- How to display a link in a Label
- How to add margin to a Label
- How to add top margin to a Label
- How add padding to a Label
- How to add an item at DropDownList at index 0
- How to change DropDownList selected item color
- How to highlight an item in a DropDownList
- How to apply ListBox auto height