WordPress.org

Ready to get started?Download WordPress

Forums

Getting height of div (7 posts)

  1. sefa
    Member
    Posted 8 years ago #

    Is there any way I can get the height of a specific div class/id? I've given up on trying to figure out why the sidebar keeps moving, so instead I've decided to just position it and the post divs a certain space from the top. So I was wondering if there is some kind of tag or code I can use to get, first, the height of my #masthead div, and second, some kind of if/else code so that the posts don't load on top of each other (like, if already a post, get height, add height to #masthead's height; this far from top, else, #masthead's height from top).

    When I type it all out it sounds much more complicated than it did in my head. I've checked the codex, but haven't found anything yet.

  2. whooami
    Member
    Posted 8 years ago #

    Its been said a 100 times, heres the 101st:

    Install Firefox:
    http://www.mozilla.com/products/download.html?product=firefox-1.5.0.4&os=win&lang=en-US

    Get the Web developer extension for Firefox:

    http://chrispederick.com/work/webdeveloper/

  3. sefa
    Member
    Posted 8 years ago #

    Relax, there's no need to be rude. I already had Firefox, and although that thing is pretty cool, if I wanted to know the height in one browser, I could just printscreen and find it out that way. I was asking if someone knew a way to find and print the height of the div so it would work in FF and IE. So, not only was your rudeness unnecessary, you didn't read my post or you'd have read the part where I explained *what* I wanted it for.

  4. whooami
    Member
    Posted 8 years ago #

    If you think that was rude, you havent read much here.

    As for my answer. I answered your first question.

    Additionally, one pixel is one pixel is one pixel regardless of browser and resolution, so given this,
    so instead I've decided to just position it and the post divs a certain space from the top., (if i understand what you are saying), you dont need anything else.

    All that said, youre going down the wrong path, the solution to sidebar issues doesnt lie in adding code like you've suggested, it lies in working with the space you have or changing the space.

    Ive looked at your site enough to see that you havent yet figured out how to do 2 columns -- I respectfully suggest that you work out that simple matter before trying to complicate things further.

    Lastly, to answer the rest of your questions: there is no panacea that I am aware of thats going to magically adjust things like you want. Thats what good, solid code is for.

  5. sefa
    Member
    Posted 8 years ago #

    All that said, youre going down the wrong path, the solution to sidebar issues doesnt lie in adding code like you've suggested, it lies in working with the space you have or changing the space.

    This is very probably true, but I've tried implementing all of the suggestions I've found here about fixing sidebar issues and none have solved the problem. It's difficult, considering I know nothing about PHP (I know that WordPress templates aren't PHP-based, but it seems like a very basic knowledge of PHP would help), and that since WordPress has its own tags, there's really only one site that can help. Oh well, there are something like 40 pages about sidebars. I'm sure by the time I've worked my way through all of them, I'll either have found someone with the same problem as me, or learnt so much about WP along the way, that I'll be able to fix it myself.

  6. Medizinische Abkuerzungen
    Member
    Posted 8 years ago #

    Read something about style-sheets and positioning of elements. There are many things you can do without knowing the specif sizes.

    The only way to get information abot the elements after displaying them is Javascript. But whooami is right, that is the wrong way.

  7. sefa
    Member
    Posted 8 years ago #

    But whooami is right, that is the wrong way.

    I know whooami is right, but only one person has responded to my post about trying to fix the sidebar, and their post didn't solve the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.