Css Floating Trouble - cant get a background color

Pages: 1, 2
free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

Css Floating Trouble - cant get a background color

jlhaslip
or add the background colour to the floated elements and have each of them share the screen width. Like this:
CODE


<div>
<span style="float: left; width: 50%; background-color: #fff000">&nbsp;&nbsp;left&nbsp;&nbsp;</span>
<span style="float: right; width: 50%; background-color: #000fff; text-align: right;">&nbsp;&nbsp;right&nbsp;&nbsp;</span>
<p style="float: left; width: 50%; background-color: #000fff">&nbsp;&nbsp;left&nbsp;&nbsp;</p>
<p style="float: right; width: 50%; background-color: #fff000; text-align: right;">&nbsp;&nbsp;right&nbsp;&nbsp;</p>
<span style="float: left; width: 50%; background-color: #fff000">&nbsp;&nbsp;left&nbsp;&nbsp;</span>
<span style="float: right; width: 50%; background-color: #000fff; text-align: right;">&nbsp;&nbsp;right&nbsp;&nbsp;</span>
</div>



It worked with both paragraph and span tags when I checked it. Not certain what you will see in your browser, though. Might have to reduce the width a bit. Like 45% or something, depending on how the page margins are set for the rest of the page and how you want it to look.

 

 

 


Reply

Lozbo
No, one is floated left and the other is floated right, well that was before, now i changed the p for div, and only left the p#breadcrumb floated left and the other div just aligned right (text-align:right).

And now it shows the background, and it does expands to contain them... In other words it got fixed, but by adding adicional divs, though i wanted to avoid it...

Tyssen what i meant is that i had the next div with a rule that set it to "clear:both" so that it wont float anymore, and the normal flow of the document continues without floating...

Reply

jlhaslip
QUOTE(Lozbo @ Oct 25 2005, 05:29 PM)
The solution you propose has only one div and floated to the right, not sure what principle can i apply that differs from what i already have,
-10730
*



Lozbo,


We are only trying to assist you with this problem. Often the answers provided will give you enough information for you to help yourself. One of the best learning techniques is to "seed" an answer and have you find the balance of the solution. Learning by researching the topic and doing it yourself is a better lesson learned. Given the small amount of information in your first post, I thought you would be able to complete the answer based on the information I had given. Apparently not.

Does my last reply help? The one with the span tags? Or maybe I am not understanding what it is that you are asking?

 

 

 


Reply

Lozbo
jlhaslip, im sorry i meant no offense, i am all the way working, i mean, while working in the file itself, i was seeking questions i was trying different things, just wanted to make clear that i did not see a pattern or something that i didnt know that actually helped me, not saying that you dont know, what i meant is that that particular thing didnt helped me to fix the particular issue, but i do apreciate everyones help and i know that im not only meant to sit back while some one does the job for me (though some people are willing to do so, and even i would offer that help if i can for other member)...

I do apreciate your help and everyone elses, meant no offense... Im still working in it, just having difficoulties and sharing them here...

Your other post about the span tags was also helpful, thanks smile.gif

Im not as good as id like to be, im trying and actually im learning.. and i thank you for helping me, i would only ask not to desperate with my questions smile.gif

Now i have a new topic with the same trouble, at least the 'pattern' and i havent figured it out...

-10730

Reply

Tyssen
QUOTE(Lozbo @ Oct 26 2005, 11:05 AM)
Tyssen what i meant is that i had the next div with a rule that set it to "clear:both" so that it wont float anymore, and the normal flow of the document continues without floating...

Sounds like an awkward workaround. I'd want to get a better look at your page with it's CSS & HTML - refer to the PM I've sent you.

Reply

jlhaslip
Lozbo,
No offense taken. I was just explaining my approach to the assistance I supplied.
I hope you solve the problem and share the solution here for us to also learn from.
Sounds like you are determined enough to find the answer you are looking for.
Good luck with it.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2
Recent Queries:-
  1. background colour to a p tag - 1005.93 hr back. (1)
Similar Topics

Keywords : css, floating, trouble, background, color

  1. Test Ul/color
    (0)
  2. Need Help With Javascript Drag And Drop Script
    Having trouble with javascript drag and drop script. (2)
    hi, i have been trying to create a drag and drop menu for my new website, so that the navigation
    menu can be moved around the site. This is the code i have: CODE <html> <head>
    <title>Test run - Right click menu</title> <script
    type="text/javascript"> function coordinates(event) { if
    (event.button==2)   { var x=event.x; var y=event.y; }
    document.getElementById("element").style.left=x;
    document.getElementById("element").style.top=y;
    document.getElementById("eleme....
  3. Finding The Rgb Color Of An Image
    Using any programming language (3)
    hello friends i am doing a project , in that i am inneed to fine the mean RGB value of a particular
    image , is there any program in any language which can do this ? the input to the program will be
    any image ( can be linked in the program) and the putput must be the mean RGB value of that
    particular image , is this Possible ? If so please post the Coding , no matter in what ever language
    it may be written.Thanks in Advance....
  4. Having Trouble Accessing Google
    (1)
    I opened my computer this morning very excited about checking my email but to no avail because till
    now I am having a hard time connecting to gmail and google. I already tried a few things like 1.
    reset my modem 2. virus and malware scan my computers but as I found out it's not only a
    problem in my pc. It's a problem in all of the pcs here at home as well. We're all connected
    to the internet via a wireless hub (linksys). Well recently I found out that the firmware of our
    hub is corrupted (meaning people could connect to our network and use our interne....
  5. I'm Having Trouble Registering [resolved]
    (my application is accepted, but not going through) (6)
    I joined the forums here a week or two ago. I worked my credits up to about 39 and applied for an
    account (I became completely approved). However, when I tried registering my account, my browser
    was stuck on the "Xisto" page for about 48 hours. It just kept telling me to wait (it could take a
    "long time"). Eventually, I had to close my browser because it was using exorbitant levels of RAM.
    I lost all my credits anyway. I'm wondering how to fix that. Does my application require human
    input after being approved? I thought it was completely automatic, so I appli....
  6. Browser Compatibility Problem With Firefox - Javascript + Css
    Having trouble making a script work right - any suggestions? (3)
    Hi, Im working on a website, and im trying to make a right-click menu, which opens on right click,
    wherever the cursor is, and closes on mouse out. I wrote the code below, and when i ran it in IE it
    ran fine, just how i wanted it to work. However in firefox, the menu just opened in the top left. im
    presuming this is because it doesnt like my style changing in the javascript. Any ideas, and
    suggestions? If i cant make this work, i will just make it so it works slightly differently when
    viewev in firefox so that it can just open in one place. All ideas appreciated. ....
  7. The Olympics-more Trouble Than It's Worth?
    (6)
    I love watching the Olympics like many other people. It is pretty cool to see athletes from all over
    the world compete in sporting events. However, it seems to me that the Olympics may be causing more
    trouble than what it's worth. The debate over drug involvement, underage gymnasts, tie scores,
    dropping s medal on the ground, and falling on the vault are all examples of things that have been
    debated. It seems to me that all of these things are ruining the Olympics. What's the point in
    winning a gold medal when everyone questions it? It seems to me that the Olympi....
  8. Creating A Floating Javascript Docking Menu
    (1)
    I have found two scripts. I found one(shown bellow) here that creates a floating box that will
    follow you down the page when you scroll. I found another one here that creates a docking menu
    like that of OSX. Now I want to combine these effects to create a docking menu that floats and
    follows you everywhere you scroll to on the page. In the above code I change the div class from
    floatdiv so that it could use the style in the style.css that came with the docking menu. I then got
    stuck trying to make both JavaScript scripts work on the same div. I'm appealing ....
  9. Cms?
    Trouble!!! (2)
    I installed a CMS which is called Slaed. This is the mistake I am getting on the main page: QUOTE
    Warning: unlink(config/counter/sess.txt) : Permission denied in
    /home/alex1985/public_html/function/function.php on line 1607 How can I solve it? Your
    suggestions?....
  10. Kei Igawa: The Story And Analysis
    Background and analysis of Kei Igawa (0)
    December 14th, 2006, the Boston Red Sox officially purchased Daisuke Matsuzaka from the Seibu Lions
    for a $51,111,111.11 posting fee, and afterwards signed him to a six year, $60 million
    contract ($52 million guaranteed). Five days later, the New York Yankees purchased Kei Igawa
    from the Hanshin Tigers. They paid a $26,000,194 posting fee, and signed Igawa to a 5 year,
    $20 million contract (totaling $46,000,194). Was the signing of Igawa an “Oh my God, the
    Sox just got Matsuzaka” PR move, and were there better options? The Bronx Bombers Blog....
  11. Mime Type Trouble
    (3)
    I have been trying to validate my site with xhtml 1.1 and I am supposed to serve it as an
    application vs. text/html... 1. It recommends changing to .xml or .xhtml extension but when I do
    this in my home folder it doesn't recognize the extension and calls is text/generic. 2. Yes, i
    have added the mime type in apache, but I don't know why it doesn't recognize it?? It
    recognized a pearl script I made. 3. I also tried adding a perl script to the top of my pages to
    declare mime type but it doesn't seem to be working. How can I get cpanel to recognize these ....
  12. I Made The Color Guard.
    (7)
    So today we held auditions for the high school's color guard. For those of you who don't
    know what that is, it's the people who twirl flags at the football games. It's a lot of
    fun. well I thought I would just let you know. Hahaha.....
  13. Cpanel Help, Trouble Logging In.
    Cannot login as it states "Login Attempt Failed!" (4)
    Before I was able to login within my Cpanel without problem but now I try to login and it states
    "Login Attempt Failed!" which makes no sense. I made sure nothing was written incorrectly within
    the fields but yet I get this error. ;-; I hope I wasn't hacked or anything.... anyone has any
    idea of what this could mean?....
  14. Runescape Through A Proxy
    I'm having trouble running Runescape through a proxy server (2)
    I use GhostGo when I surf the web most of the time because it helps protect my privacy. One
    problem I've encountered, is playing Runescape on it. A picture of my screen is attached. I use
    Safari to play Runescape. I'd rather not, but I will use Firefox if I need to.....
  15. Absract Background!
    Abstract Background! (0)
    Well I made a abstract background for people to use. Background. An example of a sig i no its
    plain. Hope you like....
  16. Nasal Irrigation For Sinus Trouble
    (4)
    Has anyone ever tried nasal irrigation? I have, it works wonders!....
  17. Trouble Creating Hosting Account
    i would have posted in the HOSTED MEMBERS section but.... (20)
    I need urgent help! When i recieved my email for comfirmation of my hosting account - i went to
    trap17.com/manage/index.php. Logged in and created a hosted account. At the top of it it said "There
    were problems creating your account! Please Contact Administrator. " But i went to my website
    flashy.trap17.com and it was created. But now the only thing is my hosted credits were not set
    back to 0.00 and my group is still Members - not hosted. HELP ME PLEASE!! i dont want to
    get banned....
  18. Cod4 Color Guide
    (1)
    Okay, i see a lot of people trying to figure out how to use colors and blah blah. Well here's
    the guide made by me to teach you thanks. ^1 - RED ^2 - GREEN ^3 - YELLOW ^4 - BLUE ^5 - CYAN ^6 -
    PINK ^7 - WHITE ^8 - DEFAULT MAP COLOR ^9 - GREY OR DEFAULT MAP COLOR ^0 - BLACK....
  19. Healing With Color
    (10)
    So what is "healing with color" and how does it work? There are many ways to use color to help
    balance the body ( mind/emotions/soul) out. All colors operate on their own wavelength and
    everyone reacts to these in their own way. It has been shown that color does affect not just the
    senses but the body itself. There are many ways to heal with color. Let's look at some examples:
    There is healing with colored light ( subjecting yourself for periods of time under certain hues).
    Healing with color based meditations ( focusing on a color in your minds eye). Healing w....
  20. Do You Dream In Black & White Or Color?
    (27)
    Hellosies! I 'm one of those people who usually dream in VIVID colors ( more like
    technicolor sometimes lol!) and was surprised to find that some people dream only in black and
    white. So my question for ya'll is how many of you here dream in color? How many here dream in
    black and white? Okay so how many of you are super talented and dream in both versions? ....
  21. Background Image Swap Script
    Change a Background Image based on clock time (15)
    Background Image Changer Script To swap the background image from your CSS file according to the
    Server Clock Time. 1.) In your CSS file, add the following rule: CODE body {
        background: url(time.png); } 2.) Create a "folder" named time.png. 3.) Into the
    folder, place three images named morning.png, day.png, night.png. 4.) Also, in the same folder,
    create an index.php file and copy/paste the following script. CODE <?php $hour =
    date('H'); if ($hour < 12 ) {     $image =
    "morning.png"; } ....
  22. Trouble With Rpgmaker Xp
    (19)
    I newly installed RPG Maker XP and a message pops up saying. "Failed to obtain a trial activation
    code from the nTitles server!" Now what do I do?....
  23. How To Put Music In The Background Of A Powerpoint Presentation
    without having the viewer download the music file (11)
    Well, i made this power poit presentation in memory of my grandfather as many of you kno, passed
    away exactly a week ago....and i am trying to get this song to play as background music..and i did,
    but there is one humongus problem... in order for the people who are viewing it to hear the
    background music they have to download the music file as well ad the powerpoint presentation, which
    on my DSL conntection taked almost 2 minutes, and i could just imagine what it will be for a dial-up
    user (my grandma who wants to see it)... Some people may say, its impossible, but i kn....
  24. [photoshop]grunge Abstract Sig ~ Samma
    Includes Multi Color Method (9)
    Im not sure if this has been done before... I havent seen a grunge abstract tut before, but anyways
    here it is /tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /> Outcome:
    1. Fill the canvas with black, and brush with white using a grunge brush. After you have
    completely filled the whole layer with the grunge brush, go to Image > Adjustments > Auto Contrast,
    then go to Filter > Sharpen > Sharpen Edges, then finaly go to Edit > Fade Sharpen Edges and do an
    opacity of 50%. Make a new layer. Repeat Step 1. another 2 times using different gru....
  25. Changing Background Color In Php
    usefull for templating. (5)
    Tutorial on how to change background color with PHP I will be descibing to similiar ways that
    you can change the background color of your website with php and leave it at that till the user
    changes it again. We are going to do this with CSS. You can either have your cSS info on your page
    or in a spereate document. The first thing youll have to do is decide if your going for the linked
    stylesheet or directly on your page. IF you link it you'll need to have this code in you
    tags. CODE <style type="text/css"> <?php include ("st....
  26. Windows Update Trouble
    Office XP Service Pack 3 (7)
    I tried downloading Office XP Service Pack 3 And when I try to download it I Get this box that pops
    up QUOTE Title says: Microsoft Office XP Professional with FrontPage The feature you are
    trying to use is on a network resource that is unavailable. Click ok to try again, or enter and
    alternate path to a folder containing the installation package “PROFLUS.MSI” in the box below Use
    source. C:\Documents and settings\Owner\Desktop (In a drop Down Menu) Then there is
    3 options (OK, Cancel, Browse…) Kind of puzzled as to how I could install the win....
  27. Fixed Background Image
    Just little reminder (10)
    Easy teahnic, post the following codes between and QUOTE <!--
    body{background-image: url( under.gif ); background-repeat:no-repeat; background-attachment :
    fixed; background-position: 10% 20% ;} --> For red colour, change it to your
    image's location. For green colour, it is used to set horizontal and vertical position of
    background image. I hope it can help you. /tongue.gif' border='0' style='vertical-align:middle'
    alt='tongue.gif' /> ....
  28. Having Trouble Installin Half Life 1 On Windows Xp
    help me plz... (8)
    im havin trouble installing half life 1 on my computer it meets all the requirments and stuff but it
    wont install and ive read because im using windows xp but ive also read ppl got it to work even
    though there usin windows xp i tried steam but that didnt really help it installed but kept screwin
    up so if anyone has any suggestions plz post them....
  29. Neomail, Horde, Squirrelmail
    What's the deal?? Having trouble here... (4)
    I'm using an email address under my domain and had been using Neomail to check it for most of
    the time that I've been hosted (less than 2 months now). Not long ago I tried Horde and
    switched to it because it looked nicer. At first, my emails weren't visible in Horde, but later
    they appeared and I couldn't see them in Neomail anymore (I don't know how this happened or
    what I did.) But since using it, Horde was giving me trouble so I decided to switch back to Neomail.
    So I logged into Neomail, but my messages haven't gone back to it. Next, I al....
  30. Flash Movie As Background?
    - Is it possible? (20)
    Can I create a Flash movie, with sound, and set it as my background for my site? I don't want
    this flash movie to be the body background, but in a cell. If somone knows a code for that, do tell.
    , thanx Nickmealey....

    1. Looking for css, floating, trouble, background, color

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for css, floating, trouble, background, color

*MORE FROM TRAP17.COM*
Similar
Test Ul/color
Need Help With Javascript Drag And Drop Script - Having trouble with javascript drag and drop script.
Finding The Rgb Color Of An Image - Using any programming language
Having Trouble Accessing Google
I'm Having Trouble Registering [resolved] - (my application is accepted, but not going through)
Browser Compatibility Problem With Firefox - Javascript + Css - Having trouble making a script work right - any suggestions?
The Olympics-more Trouble Than It's Worth?
Creating A Floating Javascript Docking Menu
Cms? - Trouble!!!
Kei Igawa: The Story And Analysis - Background and analysis of Kei Igawa
Mime Type Trouble
I Made The Color Guard.
Cpanel Help, Trouble Logging In. - Cannot login as it states "Login Attempt Failed!"
Runescape Through A Proxy - I'm having trouble running Runescape through a proxy server
Absract Background! - Abstract Background!
Nasal Irrigation For Sinus Trouble
Trouble Creating Hosting Account - i would have posted in the HOSTED MEMBERS section but....
Cod4 Color Guide
Healing With Color
Do You Dream In Black & White Or Color?
Background Image Swap Script - Change a Background Image based on clock time
Trouble With Rpgmaker Xp
How To Put Music In The Background Of A Powerpoint Presentation - without having the viewer download the music file
[photoshop]grunge Abstract Sig ~ Samma - Includes Multi Color Method
Changing Background Color In Php - usefull for templating.
Windows Update Trouble - Office XP Service Pack 3
Fixed Background Image - Just little reminder
Having Trouble Installin Half Life 1 On Windows Xp - help me plz...
Neomail, Horde, Squirrelmail - What's the deal?? Having trouble here...
Flash Movie As Background? - - Is it possible?
advertisement



Css Floating Trouble - cant get a background color



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE