Taorluath Posted February 11, 2008 Share Posted February 11, 2008 Here's my problem. I'm trying to display a blog post with a Poster's Name, a Title, and some Content. This is in a <div> tag. I have a folder named 'lines' which contains horizontal and vertical brush-stroke images. The php randomly selects 2 vertical and horizontal lines, and uses them as a pseudo-border. These should stretch to fit the size of the <div> tag. But for some reason, some of the time the <div> is shorter than the text, even though its height is set to "auto". Sometimes it works. Here's the code and two images; one halfway working, and the other is screwed up and too short. The only difference between the two images is that I refreshed the page in between the two. (Each time I refresh the page, it changes.) h2 {line-height:30%} div#post {height:auto; width:30%; position:absolute; left:300px; background-color:red;} #content {position:absolute; z-index:1; padding:17% 12% 9% 12%; font-size:70%; clear:none} #right {width:8%; height:90%; position:relative; top:7%; float:right} #left {width:8%; height:90%; position:auto; top:7%; float:left} #top {width:100%; height:5%; position:inherit; float:left;} #bottom {width:100%; height:5%; position:relative; float:left } #spacer {width:100%; height:9px; display:block; margin-left:auto; margin-right:auto; } #content {position:absolute; z-index:1; padding:5% 12% 9% 12%; font-size:110%; clear:none} <?php $v1 = "/lines/v".rand(1,15).".png"; $v2 = "/lines/v".rand(1,15).".png"; $h1 = "/lines/h".rand(1,10).".png"; $h2 = "/lines/h".rand(1,10).".png"; ?> <html><head> <style> @import "main.css"; </style></head> <body> <div id="post"> <center><h1>Andrew</h1></center> <div id="main"> <img src="<?php echo "/lines/h".rand(1,10).".png"; ?>" id="top" /> <img src="<?php echo "/lines/v".rand(1,15).".png"; ?>" id="left" /> <img src="<?php echo "/lines/v".rand(1,15).".png"; ?>" id="right" alt="right" /> <div id="content"> <br /> <h2>Test Post</h2> <img src="<?php echo "/lines/h".rand(1,10).".png"; ?>" id="spacer" /><br /> THis is a test..... LAH ALHA LHA. aasdfssdffd asdf ddddd adsfasdfas sdfsdafwswfdsasdf sdafasdf sadfa sad fsdf sdddf dfd fdf dsafasdfahhrtgfg jvcbn hjhj h jkl;hkjh kjh kjadsf sdf sd fs df a dsf asdf dsaf dsfsakdfjksdf d skfjsakdf </div> <img src="<?php echo "/lines/h".rand(1,10).".png"; ?>" id="bottom" /> </div> </div </body> </html> [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/90580-borders-with-images/ Share on other sites More sharing options...
Taorluath Posted February 11, 2008 Author Share Posted February 11, 2008 BTW, I removed the CSS for the sidebar, because it would only clutter the code. In the first image, only the left-hand vertical image is not working like I want it to. Quote Link to comment https://forums.phpfreaks.com/topic/90580-borders-with-images/#findComment-464424 Share on other sites More sharing options...
Taorluath Posted February 12, 2008 Author Share Posted February 12, 2008 bump. Quote Link to comment https://forums.phpfreaks.com/topic/90580-borders-with-images/#findComment-465298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.