Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Victor Gordian
4,656 PointsTrying to align my text box
I have no idea how to align my text box with my question, as of matter of fact..I dont know if i did it correctly. Also want gather the output of the user and use an alert that comes out saying hello "user". This is my code for my text box, HTML, CSS and JS
<div id="question"> <h2>Whats is your name?</h2> <input id="textBox1" type="text1" /> </div>
question h2 {
color: #000; text-align: center; }
textBox1 {
position: fixed;
}
document.getElementById("textBox1");
Victor Gordian
4,656 Pointsoh i see, well I don't know much of JS. I don't about the value either i just deleted it, at first it was <input id="textbox1" type="text1" value=" "/> and i honestly dont know what type means and why text1 isn't valid.
Jonathan Ankiewicz
17,901 PointsWhen in doubt Google it out....
http://www.w3schools.com/html/html_form_attributes.asp
read up on it. It makes a big difference. Also these inputs are HTML 5 features not javascript.
Javascript and jQuery is what you would us to pull the data from the inputs and use it for something. Make sure you follow TeamTreehouses html5 and css developers course, you will be all caught up much sooner then you think.
Jonathan Ankiewicz
17,901 PointsJonathan Ankiewicz
17,901 PointsIt's a bit hard to understand what your asking. Align the text box to the question underneath?
If you are having issues getting your input field near your question try resting the margin & padding of the h2.
A margin-left with negative numbers always does the trick for shifting the input around.
You can attach an id or class to your input for styling purposes or you can use the (I forgot the name of this method__):
input[type="text"]{ css stuff here} - This will style anything input field that is of the text type.
You can change any attribute with any used in the input, such as: input[name="yourSelectedNameHere"]{css.....}