Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing some controls dynamically at the bottom 1

Status
Not open for further replies.

markros

Programmer
May 21, 2007
3,150
US
Hi everybody,

We're writing Prev/Next buttons in code using

<div class="cl" style="padding-top: -40px">

<script type="text/javascript">TabNav(5,8)</script>

</div>

I manually found the padding-top for all other tabs. In one tab where I'm trying to use negative padding it doesn't work in IE7.

Any other way to be able to put the information close to the bottom?

Thanks in advance.
 
I would say kudos to IE7. From W3C CSS2.1 spec:
W3C said:
Unlike margin properties, values for padding values cannot be negative. Like margin properties, percentage values for padding properties refer to the width of the generated box's containing block.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thanks a lot, but could you please explain how can I make it to work? May be you can show an example?

I'm a newbie in CSS.

Thanks again.
 
Use negative margin. Margins can have negative values.
Code:
<div class="cl" style="margin-top: -40px">
  <script type="text/javascript">TabNav(5,8)</script>
</div>
That said, I am wondering why you would need to shove this manually upwards a certain amount of pixels... There has to be a better way I think. But you would need to tell us what exactly you're trying to accomplish.


___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
I have custom made tabs. At the bottom of each tab we're showing Prev/Next button written with
Code:
function TabNav (id,last){
    var prvs=(id>1)?'<span class="TabNav" onclick="showReport('+(id-1)+','+last+')" title="Previous Tab">&laquo;&nbsp;Back</span>':'';
    //var pipe = (last||id==1)?'':'&nbsp;|&nbsp;';
    var nxt=(id<last)?'<span class="TabNav" onclick="showReport('+(id+1)+','+last+')" title="Next Tab">Next&nbsp;&raquo;</span>':'';
    document.write(prvs+nxt);
}

I want this text to be on the same place for each tab. Yesterday I visually adjusted padding for each of the tabs.

I'll try margin for the last tab, thanks to you again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top