Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 02-11-2011, 10:51 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
DIV left and right borders only?

Hi,

I am trying to set left and right borders to my DIV. No upper and no bottom border... they are already images, placed.

How to make only left and only right borders without any images?

Currently I am using background images Slower load is the problem!
 
Reply With Quote
  #2 (permalink)  
Old 02-11-2011, 01:36 PM
HTMLBasicTutor's Avatar
Super Moderator
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 18,056
iTrader: 5 / 100%
Quote:
The CSS border properties allow you to specify the style and color of an element's border.
CSS Border - w3schools
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
Reply With Quote
  #3 (permalink)  
Old 02-11-2011, 02:29 PM
Member
Latest Blog:
None

 
Join Date: 01-31-11
Posts: 32
iTrader: 0 / 0%
You should use

border-left:...
border-right:...
 
Reply With Quote
  #4 (permalink)  
Old 02-12-2011, 12:31 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
In fact, I already tried that, but for some reason, it didn't work with border left and border right...

Will be back after some experimentation. I thought I was making a mistake, that's why I asked.

So, prolly it just did not propagate for some reason
 
Reply With Quote
  #5 (permalink)  
Old 02-12-2011, 01:44 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
This is what I have and the left and right borders don't show up at all:
Code:
} #experiment{ width: 300px; height: 15px; border-left-color: #003399; border-right-color: #003399; text-indent: 0px; background-color: #88FFA6; float: left;
What could the problem be?

Last edited by HTMLBasicTutor; 02-12-2011 at 04:16 PM.
 
Reply With Quote
  #6 (permalink)  
Old 02-12-2011, 06:52 AM
Member
Latest Blog:
None

 
Join Date: 01-31-11
Posts: 32
iTrader: 0 / 0%
Try this
Code:
#experiment{ width: 300px; height: 15px; border-left:1px solid #003399; border-right:1px solid #003399; text-indent: 0px; background-color: #88FFA6; float: left; }

Last edited by HTMLBasicTutor; 02-12-2011 at 04:17 PM.
 
Reply With Quote
  #7 (permalink)  
Old 02-12-2011, 08:42 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
Thanks!
But what was my mistake?

The reason why I kept the {} in the form presented was the fact that I had CSS instructions before and after as well.

Thank you!
 
Reply With Quote
  #8 (permalink)  
Old 02-12-2011, 09:19 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
I guess I forgot to use "solid"

My next problem is that these left and right borders aren't going all the way down with the DIV. I wrote some content in it and they don't go down... Like they are not high enough.

Didn't specifiy their height, so what can I do now?
Would like to set the height to follow automatically as I enter content.

I have this CSS:

Quote:
} #advertisements {
width: 268px;
border-left:1px solid #000000;
border-right:1px solid #000000;
background-color: #666666;
font-family: arial;
text-indent: 0px;
font-size: 5px;
color: #000000;
Tried height "auto" and "100 %", but the lines still remain short, "stuck"...
 
Reply With Quote
  #9 (permalink)  
Old 02-12-2011, 09:33 AM
Member
Latest Blog:
None

 
Join Date: 01-31-11
Posts: 32
iTrader: 0 / 0%
Set margin to zero and check the results.
 
Reply With Quote
  #10 (permalink)  
Old 02-12-2011, 10:30 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
Makes no sense, it was normal before, it was zero before.

Solved with a trick... I placed a <BR> and it filled

Seems like the DIV did not fill, not even background was filling, because there was a left-aligned image and the text near it didn't go all the way down near that image. Seems like DIVs need the text to "go down on them" (meaning: text should fill the DIV height). And then they (the DIVs) stretch all the way down!

Last edited by davelev; 02-12-2011 at 10:36 AM.
 
Reply With Quote
  #11 (permalink)  
Old 02-12-2011, 11:09 AM
kos's Avatar
kos kos is offline
Coding Tiger
Latest Blog:
Happy New Year 2013

 
Join Date: 04-13-07
Location: .ro
Posts: 4,030
iTrader: 3 / 100%
my two cents:

if you have an element that contains other floating elements then the those elements will overlap the parent element; to fix that you should set: overflow: hidden; min-height: 0; so the parent will adjust its width and height accordingly to its content. at least this is what I do and it never fails and also saves me from a lot of headaches...

Last edited by kos; 02-12-2011 at 11:10 AM. Reason: spelling
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Images & Borders LinusIT Coding Forum 1 08-04-2010 11:49 AM
Borders - different size in FF and IE6 Emsan Coding Forum 7 03-21-2008 11:04 AM
Images as borders sinster Coding Forum 4 09-16-2007 09:35 PM
Inner Table Borders fstop71 Coding Forum 14 09-13-2004 08:55 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 12:32 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.