CSS - Need Help Positioning This Image Inline With An Input Box
I have a page where I'm building a search function.
I'm trying to make this little magnifying glass image I have line up with the input field, but it looks like it's offset to the top just a little bit. Here is my code: HTML Code: <div class="search"> <form id="srch_box"> Search Terms: <br/> <input type="text" id="search_txt" /> <img src="img/magnifier.jpg" alt="Search"/><br/> Advanced Search >><br/> <input type="button" class="submit" id="search" onclick="sendRequest();" value="Search"/> </form> </div> CSS Code: .login, .search { padding: 0 10px 0 10px; font-weight: bold; vertical-align: bottom; } Similar TutorialsI'm not completely new to css, but I am new to trying to do a totaly tableless layout. What I'm trying to achieve (which is just a very small part of the overall layout) seems like it should be simple enough but I can't seem to figure it out. Here's a link for visuals and the code. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="styles.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- #testBg { background-image: url('signInBg.jpg'); height: 46px; width: 333px; padding-left: 5px; color: #FFFFFF; } #testBg form { display: inline; } #testBg input { margin: 10px 5px 0 20px; } --> </style> </head> <body> <div id='testBg'>Sign In: <form action="login.php" method="post"><input name="username" type="text" value="(username)" size="12"><input name="password" type="text" value="(password)" size="12"><input name="action" type="image" value="login" src="go.jpg"></form></div> </body> </html> No matter what I try (which isn't saying much with my limited experience) I can't make the go button line up next to the right side of rest of the blue bar. Any help or links is appreciated. Thanks In the code below you see i have a container div. Inside of that are two divs. I would like the two divs to align side-by-side and valign to the top of the container div. I can get them side-by-side, but not to valign both to top. What am i doing wrong? Code: <div class="" style="width:530px; border-width:1px; border-style:solid; border-color:#ccbbaa; text-align:left; padding:10px;"> <div class="" style="position:relative; z-index:7; width:300px;"> Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Defacto lingo est igpay atinlay. Marquee selectus non provisio incongruous feline nolo contendre. Gratuitous octopus niacin, sodium glutimate. Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito. Epsum factorial non deposit quid pro quo hic escorol. Marquee selectus non provisio incongruous feline nolo contendre Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. </div> <div class="" style="position:relative; z-index:6; width:200px; left:320px;"><IMG src='test.jpg' width='125'></div> </div> Currently I am building a not for profit food website. An aim of the site is using pure CSS positioning - no tables. The problem I have encountered relates to positioning two images side by with heading text below within a positioned DIV. The screen design can be seen here Note the Recipe box which contains the two images of Hummus and Roast Duck. Getting this into HTML and CSS is proving to be difficult. My efforts can be found here Within the containing DIV I have placed two DIVs to hold each image and eventually the text headers. Code: <div id="SplashContainerLeft"> <h3><a href="#">Recipes</a></h3> <div class="ContainerTest"> <img class="" src="images/recipes/homus.jpg" alt="homus"/> <!-- <p class="SplashImageTitleLeft">Homus</p> --> </div> <div class="ContainerTest" style=""> <img class="" src="images/recipes/roastduck.jpg" alt="roastduck"/> <!-- <p class="SplashImageTitleRight">Roast Duck</p> --> </div> </div> The CSS is as follows Code: #SplashContainerLeft { border: 2px solid #DFDFFF; margin-left: 30%; width: 15%; } #SplashContainerLeft h3{ text-align: center; text-transform: uppercase; } #SplashContainerLeft h3 a:hover{ text-decoration: none; } .ContainerTest { border: 1px solid black; /*for testing */ width: 50%; display: inline; } The problem is the width value is ignored when an element is inline. Otherwise this solution would work well. Having two container DIVs would enable the images and headers to be nicely aligned using margin: 0 auto (also not working on the pages at the mo, possible DTD problem) Does anyone have any suggestions? Thanks for anyones help and time in advance.. Even if you just read the post. BuR Hi, I have sort of a strange problem. I'm making a centered website, and I have a shopping cart image which is actually a submit button for a form. If I make it just a plain image it looks like this: http://www.rit.edu/~jtn5684/test/index1.html However, when it's an <input type="image"> (which is what I need) it moves it drastically. http://www.rit.edu/~jtn5684/test/index2.html My styles are he http://www.rit.edu/~jtn5684/test/styles.css Any idea how to make index2 look like index1 while using <input type="image">? Thanks! Jon I have an input box with CSS positioning on it that only breaks in IE7. The input box is contained in a div that lives inside a <td>. when the pages loads, the input box is out of position. When I click on a checkbox, it immediately slides into the correct position. The strange thing is, the checkbox makes an onclick call to a function that contains JQuery dealing with disabling and enabling the field. No positioning or css is manipulated in that function. It almost seems like the position of that input box is not loading when the DOM loads. However, with that in mind, I used the developer tools for IE7 (the only browser it messes up in) and noticed when the page loads it has the correct values in the CSS style. When I click the checkbox and the input box moves, the values never change. The page doesn't recognize the input box is in the wrong location. Please help!!!!! I am including my CSS below: form div input.fileUploadbox_overlay_FuelSurcharge { position: relative !important; width: 209px !important; margin: 0 55px 0 -288px !important; } Hello, I'm trying to achieve an effect using a background image with an inline element. Specifically, I have certain hyperlinks that I want to display a graphical arrow to the right of. Essentially, it looks something like: Hyperlinked text here >>> Where ">>>" is actually a small graphic approximately 20 pixels wide. I don't want to place the image inline, because it's a visual effect and users don't need to "interact" with it. And it's also tied in with the style of the site, so controlling it through CSS is very attractive. I figured out that if I add about 20 pixels of padding to the right of the ANCHOR element, I can use the graphic as a CSS background image. Looks good in IE5+ and Mozilla-based browsers (not concerned with NS4), as long as the ANCHOR text is on one line. Problem is, when the text of the ANCHOR element breaks across two or more lines, I lose the image in IE. Of course, Mozilla-based browsers handle it perfectly -- it's just Microsoft's little problem child that's giving me fits. Anyone else have any luck using a background image on an inline element that spans two or more lines? I can't find any documented hacks or the like to help me out. Any help is greatly appreciated! -Chris I'm new to CSS. What is the best way to position an image? I tried using this: #image { position: absolute; top: 234px; left: 567px } But for some reason it doesn't work...How can I position an image? Thanks PS another thing that's been bothering me is when do you put: (in the external stylesheet) .image {..... } when do you put #image {...... } and when do you put *#image {...... } What's the difference between them and what circumstances do you use them in? Is this possible with css? I have a single table cell thats 100% wide. I want an image left aligned, an image right aligned and a background image spaning the entire cell. I also want to type text into the cell between the two images. Using html I get bugs in IE so I think css might be the better option? In the code below, why is the image not positioned at the very top of the DIV in IE only (seems to be fine in FF)? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> <style> .test { width: 200px; height: 100px; border: 1px solid #003366; } .image { position: relative; left: 0px; top: 0px; } </style> </head> <body> <div class="test"> <img class="image" src="images/block_up.gif" width="11" height="11" border="0" alt=""> </div> </body> </html> Here is the website i am struggling with, http://www.richmondsproperty.co.uk/ . i am trying to place a linked image in the top right corner, above the phone number without moving anything else. I tried to put it in a div and use float right but it just pushed everything else down. Here is the code being used Code: <div id="header"> <div id="header_logo"> <a href="<?php echo base_url(); ?>"><img src="/public/images/logo.jpg" alt="Primmer Olds logo" /></a> </div> <div id="top_menu"> <ul> <li><a href="<?php echo base_url(); ?>" <?php echo ( uri_string() == '' ? ' class="down" ' : '' ); ?>>home</a></li> <li><a href="<?php echo base_url(); ?>about-us/" <?php echo ( preg_match("/\babout-us\b/i", uri_string()) ? ' class="down" ' : '' ); ?>>about us</a></li> <li><a href="<?php echo base_url(); ?>why-choose-us/" <?php echo ( uri_string() == '/why-choose-us/' ? ' class="down" ' : '' ); ?>>why choose us</a></li> <li><a href="<?php echo base_url(); ?>lettings/" <?php echo ( uri_string() == '/lettings/' ? ' class="down" ' : '' ); ?>>lettings</a></li> <li><a href="<?php echo base_url(); ?>news/" <?php echo ( preg_match("/\bnews\b/i", uri_string()) ? ' class="down" ' : '' ); ?>>news</a></li> <li><a href="<?php echo base_url(); ?>community/" <?php echo ( uri_string() == '/community/' ? ' class="down" ' : '' ); ?>>community</a></li> <li><a href="<?php echo base_url(); ?>home-sale-network/" <?php echo ( uri_string() == '/home-sale-network/' ? ' class="down" ' : '' ); ?>>home sale network</a></li> <li><a href="<?php echo base_url(); ?>contact-us/general/" <?php echo ( preg_match("/\bcontact-us\b/i", uri_string()) ? ' class="down" ' : '' ); ?>>contact us</a></li> </ul> </div> </div> Code: #header { margin: 0 auto; text-align: center; padding: 0; width: 980px; height: 166px; background: url(/public/images/header.jpg) no-repeat bottom right #e6e6e6; } #header_logo { float: left; margin: 0 0 0 0; width: 166px; height: 166px; background-color: #dc006c; } #header_logo img { margin: 0; width: 166px; height: 166px; } Any help would be appreciated, thanks! HTML -- CSS I decided my last layout looked like poop so I'm changing it. In FF the center logo fits right in the middle of the background image to give it a stretching effect. In IE the image is slightly above the baseline. (maybe 3-5 px) Any help here? I am building a site and using CSS selectively where I need to control positioning. The site is tapmytrees.com I am having an issue controlling the positioning of the "Add This" image at the footer of the page. I am able to position this right, center, or left, but other than that, have no luck. Currently I am using the following code: #divAddThis { text-align:center; } I am able to use this code to control the positioning of the line below this image: #divLive { float:left; /* moves to right in footer*/ left:-24px; /* adjusts position */ position:relative;/*needed for left and bottom to work*/ text-align:left; /*align text*/ bottom: 5px; /*move up a bit off the search line*/ } When I try to apply the same code to #divAddThis, it has no effect. In fact, using code similar to #divLive, it does not even show up when viewing the results in FireBug. Any suggestions are appreciated. Thanks. please look at this link http://sudhakargolakaram.co.in/image.html my question is how to place the image which has a curve design starting from the left till the right along with the 3 square images in between keeping this image aside the width of the wrapper is 825px which is fine the 1st div after the wrapper has content within the dark green at the very top and its width is the same as the wrapper which is 825px and the div after this are also 825px in order to have this curve image whose width is 1204px and height 266px as the 2nd div is what i need help with as of now my code is #wrapper { width: 825px; margin: 0 auto; } #contentwrapper{ float: left; width: 825px; height: 1900px; } #toprowouter{ float: left; width: 825px; height: 25px; } #menu{ float: left; width: 825px; height: 57px; color: #fff; } and code for other divs just for the sake of this 1 image with 1204 X 266 i guess it is really not needed to change the wrapper to #wrapper{ width: 1204px; margin: 0 auto; } and there after all the other divs will need to have a width of 1204px and i will have to apply padding on left and right to a container div so that the actual content will have a width of 825px how is it possible to have the image with 1204 X 266 sit inside the wrapper whose width is set to 825px or should i change the wrapper width to 1204px just because of this big image please provide the code for this thanks. I'm working inside of a classifieds software app and trying to position a button inside an area that I don't have access to the raw HTML. I built the image file and I know where I want it to appear on the page, but don't know the correct parameters to put in to get it there. I would like it to find the center of the page then go left 190 pixels and be about 400 pixels down from the top. Site is http://www.ineedihave.com. I have the following Code: <td rowspan="2"> <img class="gallerypic" name="<?php echo $pic['filename']; ?>" src="pictures/thumbs/<?php echo $pic['filename']; ?>" width="<?php echo $pic['thumb_width']; ?>" height="<?php echo $pic['thumb_height']; ?>"> </td> <td> <div class="header">Caption</div> <div class="captionText">CaptionText</div> </td> I want the two div's to be positioned at the top of the TD they are in. I tried all different positioning stuff in thee CSS for their classes. What am I missing here? I really hate CSS sometimes. Do I need to style the TD to get this working? I am very new to web design. I had an old friend of mine design this website for me: directdevelopmentinternational.org I am now trying to use what he did for that website you put together my bands website: throughtheconcreterecords.com I am trying to get the navigation bar to sit inside of the blank white box I have created in my header image. I also just want the text to be black and maybe when highlighted change to a different color. I also am trying to make it so when you click the burning book logo in the upper left corner it brings you back to the main page. I am having a terrible time figuring out how to do this as I am not sure what all of the different techniques are referred to. Any help at all would be much appreciated! I have an image I want to use as the header graphic on a website. The image is 800px wide and the table is 700px wide. The graphic is meant to overlap both ends of the table. I am putting the image inside the td of the table and then setting the position to -90px relative to the table to move it across the correct amount. The problem I'm having is that the table changes width to 800px to accommodate the image. I tried putting the image outside the table but can't get the image to maintain its position relative to the table (ie when the screen width changes) Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled 1</title> <style type="text/css"> html, body { height: 100%; } #maintable { height: 100%; } .logoStyle { position: relative; left: -90px; display: block; top: 0px; visibility: visible; } </style> </head> <body style="margin: 0; background-color: #D1D1D1"> <table style="width: 700px" align="center" bgcolor="#FFFFFF" id="maintable"> <tr> <td valign="top"> <img alt="Logo" src="images/header.png" class="logoStyle" /> </td> </tr> </table> </body> </html> Can anyone let me know what I've done wrong? Hello! If i need to put background-image at the bottom of display i use such css rule: background-position: bottom; but in my case i need image to be fixed in right bottom corner. apparently i cant use two declarations like: background-position: bottom; background-position: right; so how could i attain this via just CSS? |