Jump to content

Border Position?


BenC

Recommended Posts

I was wondering if it is possible to have the border start at a fixed point instead of at 0. I want to have a border down the side of a div, but not start it until about 200px from the top, is that possible?

Link to comment
Share on other sites

Here is a link to an image to illustrate what I am looking for. The yellow line is where I need the border. After looking at it, I think I can put another one on the left, and just start it from where "2" ends. "1" changes height depending on the amount of content in it though, I'll keep messing with it unless you have a better idea than mine. Thanks!http://www.courts.mo.gov/hosted/Juded/Webc...ordersample.jpg

Link to comment
Share on other sites

From what I know, it's not possible with one element. What you coudl do is position 2 divs (on top of eachother). The first div would be 200 px high and x px wider on each side than the inner element--where x is how big the border should be. The second div should be the same, except more in height, and then you just change the background color to the color of your border. :)

Link to comment
Share on other sites

Thanks for the suggestion. I've been trying it out like that, but I think I'm running into a problem because the height is in a %, not pixels. The layer that is under won't go all the way down to the bottom of the page like the one on top, presumably because it doesn't have any content in it. Would you mind showing me the code to something like that? I'm relativaly new to css by the way, in case you couldn't tell :) I'll keep messing with it to figure something out. Thanks guys!

Link to comment
Share on other sites

Hmm...well, what you could do is somehow put a filler element inside the border element. And then put a height=100% for it. Put a z-index of lower than the upper element, and what you should get is what you need :)

Link to comment
Share on other sites

I've been messing around with it, and from what I can tell height=100% still doesn't really do anything for me. What is it "100%" of? Iteself? the page? Here's what I've done, I've created a layer and gave it this class....leftside { border-right:1px solid #cccc99; position:absolute; top:380px; left:117px; height:100%; z-index:1001; width: 52px;}I had hoped that it would continue down the page, but it only goes for about 50px or so and stops, that's why I asked about the 100%.

Link to comment
Share on other sites

height = 100% means different things in different browsers. It is hard to get it to work how you want and the smallest changes can break it.I like to use background images to simulate this instead.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...