Solved

Textbox not taking full width

Posted on 2013-11-26
2
2,116 Views
Last Modified: 2013-11-28
I am new to bootstrap 3 and I am using it in my asp.net application

I have created one login page.

I used a panel and put textboxes inside it.

The issue is the textboxes were not taking full width, I set it width=100% but nothing happens

I am not what mistake I am doing here.


here is the code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Documentation.Login" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title>Formulation Technology - Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
        <div class="container">
            <div class="row top-buffer">
                <div class="col-md-2 col-md-offset-5">
                    <asp:Image ID="imgLogo" ToolTip="Formulation Technology" ImageUrl="~/images/fti_logo.png" runat="server" />
                </div>                
            </div>
            <div class="row top-buffer">
                <div class="col-md-7 col-md-offset-3">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h1 class="panel-title"><b>Log in</b></h1>
                        </div>
                        <div class="panel-body">
                            <div class="input-group">                              
                              <asp:Label ID="lblUsername" runat="server" Text="UserName" CssClass="control-label"></asp:Label>
                              <asp:TextBox ID="txtUsername" runat="server" CssClass="form-control" />
                            </div>
                            <br/>
                            <div class="input-group">                              
                              <asp:Label ID="lblPassword" runat="server" Text="Password" CssClass="control-label"></asp:Label>
                              <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" CssClass="form-control" />
                            </div>
                            <br/>
                            <label class="checkbox">          
                                <asp:CheckBox ID="chkRememberMe" runat="server" Text="Remember Me" />
                            </label>
                                                        
                            <asp:Button ID="btnSubmit" runat="server" Text="Log in" CssClass="btn btn-lg btn-primary button300"  />
                            
                        </div>                              
                    </div>
                </div>
            </div>
        </div>
        <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
    </form>
</body>
</html>

Open in new window

1111.png
0
Comment
Question by:yadavdep
2 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39678497
Need a live link or the css - html tells us nothing.
0
 
LVL 18

Accepted Solution

by:
Matthew Kelly earned 265 total points
ID: 39683906
When a sub element is set to 100% width (like the text boxes) it will only expand to 100% of the width of the container element. In this case "input-group" contains the text boxes and those may be limited.

An easy way to see where things are is add

style="border:1px solid #000000;"

Open in new window


To the elements to see how big they are. I am assuming panel-body is what has the grey border that is as large as the "Log In" header, so likely the input-group div is not as wide as the panel-body.

Try expanding the input-group to be wider.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML and CSS for a complex page 20 61
Remove lines by logo 2 23
CSS Logo Problem. 2 8
ebay seller html tags 2 5
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now