Solved

Drupal: CSS property for a a floating box

Posted on 2010-09-16
5
409 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

813 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

14 Experts available now in Live!

Get 1:1 Help Now