lessismore Posted June 19, 2012 Share Posted June 19, 2012 Hi:I'm just trying to add a space but the things I tried didn't work...I tried typing a space and tried adding before {beds}. I'm sure this is simple... Thanks in advance! Jami <div class="group"> <div class="label"><label>Beds:</label></div> <div class="field" style="width:435px; margin-top:-3px;">{beds}</div> </div> Link to comment Share on other sites More sharing options...
ShadowMage Posted June 19, 2012 Share Posted June 19, 2012 Why don't you use a left margin instead? Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 Sorry. Forgot to mention, I tried that too. <div class="field" style="width:435px; margin-left:3px; margin-top:-3px;">{beds}</div> Maybe I wrote the code wrong? Link to comment Share on other sites More sharing options...
SnakesBite101 Posted June 19, 2012 Share Posted June 19, 2012 i think text-indent: px might work Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 :-( Sigh. That didn't do it either... <div class="field" style="width:435px; text-indent:3px; margin-top:-3px;">{beds}</div> Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 Are you sure you're using big enough numbers? 3px isn't much space. When I don't know WTH I'm doing I usually use bigger numbers to make it obvious when it works, like maybe 20px or 30px in this case. If it works you can adjust the numbers to a pleasing appearance. I'll admit I don't do CSS a whole bunch better than you do. But when I find something that works it works everywhere and I stick with it. Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 Good thought, but I'm a graphic designer, so 3 px is a very noticeable space for me. ;-)BUT I did try it with 50 px, and it didn't budge... Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 Try this: <div class="field" style="width:435px; padding-left:3px; margin-top:-3px;">{beds}</div> Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 Thanks for trying but, nope. Think it has something to do with the PHP, which I'm really not well versed with... Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 Maybe I don't understand what you're trying to do. Actually I cheated. I looked it up on the Internet. I'm almost sure the code I gave you will do that I think you want to do. Have a look at this page, scroll down to the padding-left example: http://www.pageresou...tml/csstut6.htm While you're at it, read the whole page. Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 Yeah... I do use padding and margins all the time. And know how they work. But for some reason, it is not "seeing" it. I'm thinking it has something to do with {beds} being a PHP result, not just normal text. Maybe someone well-versed in PHP will chime in... Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 Something tells me you have a cache problem. (Maybe a cash problem too, don't we all?) Clear your browser cache. Or try ctrl-F5. Or both. I forgot, I often get bit by the browser cache when I'm tweaking code. Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 I've emptied it several times... Maybe this will help...Here's what it looks like. I want more space between input field and the different beds. Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 The code you posted in your OP does not match with the image you posted. As such I cannot compare the image to the code. And honestly I'm not an expert in this, although I appear to be the only help you have today, and I'm sitting here bored, watching my sick dog. Fun day... Link to comment Share on other sites More sharing options...
lessismore Posted June 19, 2012 Author Share Posted June 19, 2012 Yes, it was only part of the code... I realized it wouldn't work in that section of the code, since I tried everything I knew. I was able to locate the PHP code, which was NOT easy. Then changed the width of the box from 17 to 13px. Jeesh. Way beyond my skill level. But it worked. $bString = ""; $b = $this->getBeds(array("byRef" => true)); foreach($b as $bed){ $bString .= " <div style=\"float:left;\"> <div style=\"float:left; width:35px;\"> <input type=\"text\" style=\"width:13px;\" name=\"bed-".$bed['id']."\" id=\"bed-".$bed['id']."\" value=\"".intval(@$beds[$bed['id']])."\" /> </div> <div style=\"float:left; width:175px; padding-top:10px;\"> ".urldecode($bed['bed_name'])." </div> </div>"; } Thanks for trying to help. Hope your dog gets better soon! Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 Okay not sure if you fixed it or not. You said "it worked." You better confirm whether or not you still have a problem. Now that I've seen your code I think what you want is margin-left:3px instead of float:left. But you already tried that. I guess it's above my pay scale too. It looks like my pay scale today is watching sick dogs. I still think you could have a cache problem. In any case somebody who is better than I at CSS will probably stumble by sooner or later and sort you out. Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 By the way, maybe one of you CSS experts can confirm my understanding of what we've been playing with here. In this case it's a <DIV> I understand that padding-left will add space inside the DIV to the left of the contents, and that margin-left will add space outside the <DIV> between it and whatever precedes it. Please don't laugh at me if I've got it wrong. Link to comment Share on other sites More sharing options...
Ingolme Posted June 19, 2012 Share Posted June 19, 2012 That's correct. A <div> is a block element. All block elements behave that way. Link to comment Share on other sites More sharing options...
Guest So Called Posted June 19, 2012 Share Posted June 19, 2012 Okay thanks. Then I don't know why the OP's problem wasn't resolved. I would think that either one would have given him his space. Maybe it's a cache issue... Link to comment Share on other sites More sharing options...
DarkxPunk Posted June 30, 2012 Share Posted June 30, 2012 I think I agree with you So Called... If I could see all the code I think I could understand it better for this guy. I am pretty good with css and screwing around with it. All your solutions should work, and I don't know exactly what he did in PHP to 'fix' it. I am not so PHP friendly yet either. To Lessismore If your willing to put up your code either in a file or by using the code button here I could try and sort through to find whats conflicting. I just want code I can throw open and test myself. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.