Solved

Drupal: CSS property for a a floating box

Posted on 2010-09-16
5
407 Views
Last Modified: 2012-05-10
On my website, that is made in drupal, I have a special area that contains language options and the login button. (top right area)

http://www.0815-taschen.de/

My question is, how do I make it float relative to the top header? so it dosent fly out of the header, Currently it's relative to the right, but as the window is resized the location changes. I understand this would be easy, but with Drupal as I am modifying the template and creating a new location(Its in a block) I can't just drop them in the template next to the logo.

My css:
#top_content {
	
	color:#03C;
	padding:5px;
	position:absolute;
	right:100px;
   
	top: 0px;
	width:150px;
	line-height: 10px;
	font-size:12px;
	
	text-align:right;
	height:20px;
	}

Open in new window






The page.tpl.php area looks as such:
</head>
<body class="<?php print $body_classes; ?>"><div id="top_content" class="top_content"><?php print $top_content ?></div>


  <div id="page">

Open in new window

0
Comment
Question by:deterius
  • 2
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 167 total points
ID: 33691474
Put the top_content div inside of the <div id="page">  but after <div id="header"> and <div id="header_inner">.  Then you should be able to float it right.
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 333 total points
ID: 33692237
You can make you own custom regions where ever you want in your theme.
0
 

Author Comment

by:deterius
ID: 33698432
thanks for the comments, so update: first of- "top_content div is a new custom region, however putting it in to "<div id="page">  but after <div id="header"> and <div id="header_inner">" didn't change much- moreover, I've added a containting div that contains the top_content div and added color backgrounds to show where they are.. BUT I can only see them when I am logged in!

They don't show up to anonymous users! Why?
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 333 total points
ID: 33698478
Might be a caching issue, kind of out of my league here. Try pressing Ctrl + F5

I think this should make your life easier,
http://css-tricks.com/absolute-positioning-inside-relative-positioning/
0
 

Author Closing Comment

by:deterius
ID: 34010770
Vague, not expert answer. Not even good understanding of a good issue - they should have asked questions to provide a good answer.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now