• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

  • CF has always been a site that welcomes people from different backgrounds and beliefs to participate in discussion and even debate. That is the nature of its ministry. In view of recent events emotions are running very high. We need to remind people of some basic principles in debating on this site. We need to be civil when we express differences in opinion. No personal attacks. Avoid you, your statements. Don't characterize an entire political party with comparisons to Fascism or Communism or other extreme movements that committed atrocities. CF is not the place for broad brush or blanket statements about groups and political parties. Put the broad brushes and blankets away when you come to CF, better yet, put them in the incinerator. Debate had no place for them. We need to remember that people that commit acts of violence represent themselves or a small extreme faction.
  • We hope the site problems here are now solved, however, if you still have any issues, please start a ticket in Contact Us

  • The rule regarding AI content has been updated. The rule now rules as follows:

    Be sure to credit AI when copying and pasting AI sources. Link to the site of the AI search, just like linking to an article.

CSS question...how to dynamically size?

WeakButHopeful

Senior Member
Oct 25, 2003
612
40
72
East Coast of USA
Visit site
✟23,470.00
Faith
Catholic
Hello to any CSS experts out there. I'm a relative newbie laying out a Web page with CSS instead of tables (the better, or more modern, way...I hear).

Can I have a logo at the top left of my Web page (float: left) and have the rest of the viewport width taken up by my top banner? In other words, I'd like to say the width of the logo is 200px, and the width of the top banner (to its right) is 100% - 200px. The height of both is 70px. I doubt you can really give math calculations as the value in a CSS statement, but that's the idea. In that top banner I have a gradient fill image.

I figure either I can't do this at all, or else I'm approaching the problem the wrong way. I've tried experimentation and Google research, but I don't seem to be getting anywhere so far.

Thanks in advance for any advice.
 
W

willab

Guest
If I understand what you want, this should help:
p
{
position: absolute;
top: 200px;
left: 100px
}
Put it wherever you need it and specify the correct place. Why do you have to have a certain amount of posts to post a link? w3schools.com has a great tutorial, but I can not link to the page. That has got to be the worst thing I have ever heard of doing to a forum.
 
Upvote 0

rdale

Well-Known Member
Feb 5, 2004
1,381
53
67
Oregon
✟31,820.00
Faith
Christian
Marital Status
Married
Upvote 0

rdale

Well-Known Member
Feb 5, 2004
1,381
53
67
Oregon
✟31,820.00
Faith
Christian
Marital Status
Married
Can I have a logo at the top left of my Web page (float: left) and have the rest of the viewport width taken up by my top banner? In other words, I'd like to say the width of the logo is 200px, and the width of the top banner (to its right) is 100% - 200px. The height of both is 70px. I doubt you can really give math calculations as the value in a CSS statement, but that's the idea. In that top banner I have a gradient fill image.

Code:
#Content {
margin:0px 50px 50px 200px;
padding:10px;
}

#Menu {
position:absolute;
top:100px;
left:20px;
[B]width:200px;[/B]
padding:10px;
background-color:#eee;
border:1px dashed #999;
line-height:17px;
/* Again, the ugly brilliant hack. */
voice-family: "\"}\"";
voice-family:inherit;
width:150px;
}
/* Again, "be nice to Opera 5". */
body>#Menu {width:150px;}

The 'meat' of this came from Left Menu
 
Upvote 0

WeakButHopeful

Senior Member
Oct 25, 2003
612
40
72
East Coast of USA
Visit site
✟23,470.00
Faith
Catholic
Thanks for the advice folks. However, if I understand what I'm reading, your suggestions will only work when the content to the right of the logo is text (which will naturally flow to fill the viewport width). My content is an img that I want to dynamically resize to take up whatever room remains from the logo. Using HTML tables I could use "width=*" but I was trying to stay CSS for the learning experience. If I specify "width: 100%" in the attribute for "TopBanner" DIV in my CSS and also "width=100%" on my img tag, then I fail because my banner falls below my logo, instead of to its right. If I could say "width: 100%-200px" in the CSS attribute and "width=100%" on my img tag, it might work (but I'm sure it won't surprise you that it didn't...I tried).

But I finally got it (thanks to your help). I used absolute positioning to lay the logo on top of the top banner gradient, which I edited in my graphics program to have a 200px white area at its left (reserving room for the logo). That way the banner can stretch to fill the area, but the logo is fixed in size and doesn't distort.

Thanks rdale04 for your detailed replies! And willab, I guess the link prohibition has got something to do with spam (i.e. robots joining a forum just to post commercial links) but I don't really know. I guess the W3Schools link in rdale04's reply was the one you would have posted. Thanks for caring!
 
Upvote 0