eduard Posted March 20, 2011 Share Posted March 20, 2011 Now the code is allright, but how do I get a bigger input field for ´description´?<html><body><form>Description: <input type="text" name="description" ><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form></body></html> Link to comment Share on other sites More sharing options...
Man In Tan Posted March 20, 2011 Share Posted March 20, 2011 Use the height and width CSS properties and a textarea. <textarea id="description" name="description"></textarea> textarea#description {width: 95%;height: 200px;} Link to comment Share on other sites More sharing options...
eduard Posted March 21, 2011 Author Share Posted March 21, 2011 Use the height and width CSS properties and a textarea.<textarea id="description" name="description"></textarea> textarea#description {width: 95%;height: 200px;} Thanks! Link to comment Share on other sites More sharing options...
cousineaug Posted March 21, 2011 Share Posted March 21, 2011 <form>Description: <input type="text" name="description" ><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form>this field is "input" so textarea will not work.The description input does not have an id or a class so you need to find a way to target it in CSSDescription: <input type="text" name="description" id="desc" ><br /> and CSS input #desc{width=100px; /*adjust width as required*/} I would nto specify the height that way it will be the height of the text.Guy Link to comment Share on other sites More sharing options...
eduard Posted March 21, 2011 Author Share Posted March 21, 2011 this field is "input" so textarea will not work.The description input does not have an id or a class so you need to find a way to target it in CSSDescription: <input type="text" name="description" id="desc" ><br /> and CSS input #desc{width=100px; /*adjust width as required*/} I would nto specify the height that way it will be the height of the text.Guy I don´t manage!Where do I have to write the CSS?<html><head>input #desc{width=100px;</head><body><form>Description: <input type="text" name="description" id="desc"><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form></body></html> Link to comment Share on other sites More sharing options...
jeffman Posted March 21, 2011 Share Posted March 21, 2011 A basic example: http://www.w3schools.com/css/tryit.asp?fil...ound-color_body Link to comment Share on other sites More sharing options...
eduard Posted March 21, 2011 Author Share Posted March 21, 2011 A basic example: http://www.w3schools.com/css/tryit.asp?fil...ound-color_body Thanks! Link to comment Share on other sites More sharing options...
eduard Posted March 21, 2011 Author Share Posted March 21, 2011 A basic example: http://www.w3schools.com/css/tryit.asp?fil...ound-color_body I saw the example, but still it doesn´t work!<html><head><style type="text/css">input #desc{width="100px";}</style></head><body><form>Description: <input type="text" name="description" id="desc"><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form></body></html> Link to comment Share on other sites More sharing options...
ShadowMage Posted March 21, 2011 Share Posted March 21, 2011 Come on, Eduard. By this point, you should be able to spot the error with this:input #desc{width="100px";}EDIT:I also just notice that your selector is a little bit off. You have a space in there that shouldn't be. Try one of these two (either will work):input#desc <--Notice no space between input and #descor#desc Link to comment Share on other sites More sharing options...
thescientist Posted March 21, 2011 Share Posted March 21, 2011 I saw the example, but still it doesn´t work!<html><head><style type="text/css">input #desc{width="100px";}</style></head><body><form>Description: <input type="text" name="description" id="desc"><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form></body></html>you're CSS is wrong, you use a colon between attributes and values, not an equals signs. Link to comment Share on other sites More sharing options...
eduard Posted March 21, 2011 Author Share Posted March 21, 2011 Come on, Eduard. By this point, you should be able to spot the error with this:input #desc{width="100px";}EDIT:I also just notice that your selector is a little bit off. You have a space in there that shouldn't be. Try one of these two (either will work):input#desc <--Notice no space between input and #descor#descIt still doesn´t work!<html><head><style type="text/css">#desc{width=200px;}</style></head><body><form>Description: <input type="text" name="description" id="desc"><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form></body></html> Link to comment Share on other sites More sharing options...
jeffman Posted March 21, 2011 Share Posted March 21, 2011 width: 200pxNotice the difference Link to comment Share on other sites More sharing options...
thescientist Posted March 21, 2011 Share Posted March 21, 2011 um...did you actually read our replies? Or just read them and ignore them? Come on, Eduard. By this point, you should be able to spot the error with this:input #desc{width="100px";} you're CSS is wrong, you use a colon between attributes and values, not an equals signs. Link to comment Share on other sites More sharing options...
cousineaug Posted March 21, 2011 Share Posted March 21, 2011 I don´t manage!Where do I have to write the CSS?<html><head>input#desc{width=100px;</head><body><form>Description: <input type="text" name="description" id="desc"><br />Price: <input type="text" name="Price" id="Price" /><br />Quantity: <input type="text" name="Quantity" id="quantity" /></form></body></html>there are three mistakes - two are mine :-(<head>input #desc /*no spaces*/{width:100px; /*replace "=" with ":"*/} /*need close bracket here*/</head> now this works in chrome, opera, ff and safari. I never have the energy to test in all IE versions.Guy Link to comment Share on other sites More sharing options...
eduard Posted March 21, 2011 Author Share Posted March 21, 2011 width: 200pxNotice the differenceGot it! ( I meant :Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.