How to keep two divs at the same height

Updated on technology 2024-02-27
22 answers
  1. Anonymous users2024-02-06

    1. Create a new html file, named it, to explain how to set the div height of jquery.

    2. In the file, introduce the library file.

    The file can be loaded successfully before the methods in jQuery can be used.

    3. In the file, create a module with div tags, and use css to set its width to 50px and the background color to red.

    4. In the file, set the class attribute of the div tag to mydiv, which is mainly used to obtain the div object through the class.

    5. In the file, use the button tag to create a "set div height" button, bind the button button to the onclick click event, and execute the editheight() function when the button is clicked.

    6. In the js tag, create the editheight() function, in the function, use the $ symbol to get the div element object, and then use the css() method in jquery to set the height attribute, for example, set the height to 200px.

  2. Anonymous users2024-02-05

    leftright

    right, the things that exceed the height are displayed, and another way is to use js control.

  3. Anonymous users2024-02-04

    For example. Turn a div into a child of another div, the div height of the child element: 100% The height of the parent element is the height of the child element, and the 2 divs are positioned.

  4. Anonymous users2024-02-03

    <>I guess you're trying to achieve that.

    If the height of the second div and the third div follows the height of the first div (or the first and second adapts. Omitted) would be great.

    If. Here I've experimented with the next three divs, all of which are inward, and you can't set height=???Or the outer layer. positon:re

    Inner layer: p:a; It's not realistic. So the upstairs don't understand, don't irrigate. Let the great god explain.

    I checked the documentation. The only solution to this problem is that it really doesn't work.

    The above is the solution of a certain great god. I copied it.

    Please pass by... Leave your thoughts.

  5. Anonymous users2024-02-02

    leftright

    rightHere the float is relative, all you need is the first div left float, so you just need to remove the float in the second div as follows:

    leftright

    right

  6. Anonymous users2024-02-01

    What I don't understand is: why do you have to make the left div grow as the right div gets taller???

  7. Anonymous users2024-01-31

    It's a bit troublesome to implement it with pure css, but I actually can't write it myself, because the top of it is aligned when it is written, and it doesn't feel like a waterfall.

    It is recommended that LZ be implemented using a js plugin.

    Search for this jquery plugin on the Internet, it's written specifically for waterfall, and you can get it by referencing its library and css**, which is the kind of effect you want.

  8. Anonymous users2024-01-30

    The most classic two-column adaptive height css**,IE,FF test passed. Hope it works for you: body pagebody sidebar mainbody * easy clearing * pagebody:

    after #pagebody /*\*/ #pagebody /* end easy clearing */ /*\*/ #sidebar, #mainbody @media all and (min-width: 0px) #sidebar:before, #mainbody:

    before } /**/

  9. Anonymous users2024-01-29

    The height inside your div can be written as the same value, and you need to display the inline block to be side-by-side, and you can try again.

  10. Anonymous users2024-01-28

    style="margin-bottom:-9999px;padding-bottom:9999px;"

    Add both. Then the upper level exceeds the hidden style="overflow:hidden"

  11. Anonymous users2024-01-27

    You set 100% high, that is, the content in the div supports the height amount, can't you set a specific value?

  12. Anonymous users2024-01-26

    Third-person shooting games, abbreviated as TPS (Third Personal Shooting Game), refer to games in which players can observe the characters they operate through the game screen and engage in shooting battles.

    Add padding-bottom: 40px to style; That's it.

  13. Anonymous users2024-01-25

    Higher browsers use display :table, and those that don't support this use padding-bottom:10000px; magint-botton:-10000px;

  14. Anonymous users2024-01-24

    Just set a fixed height.

  15. Anonymous users2024-01-23

    Does this mean that the div height is dynamically set? The height of the div is the highest height of the current line? There is also a problem with this design, in case there are 3 lines, the length of the text in each line of div is different, so the height of the div will be uneven; It's better to use the ellipsis for the extra link text of each line, and then give a title hint.

  16. Anonymous users2024-01-22

    Can I send the source code? What does this picture mean?

    In addition, the idea of handling div height consistency is as follows:

    Just set their width, height properties, and keep them all the time!

  17. Anonymous users2024-01-21

    You can modify the padding at the bottom of both sides to try or adjust the height of the corresponding div.

  18. Anonymous users2024-01-20

    I can't see your picture clearly.,You can adjust the attribute value of the height in the div.,The second is to add a big div in addition to these 3 small divs.,This might be better.。

  19. Anonymous users2024-01-19

    If you define the height, it must be caused by padding, you check it!

  20. Anonymous users2024-01-18

    You fix the height of the two divs and put them in the same container, like another big div

  21. Anonymous users2024-01-17

    Because the kernel of IE is different from the kernel of other browsers, you have to write a browser compatible**css, you look for browser compatibility** on the Internet, and then reference to the current page should be fine.

  22. Anonymous users2024-01-16

    The test in Firefox is 100%.

    You have a mistake here that the ids of the two divs nested in them are duplicated, and the ids cannot be repeated.

Related questions
11 answers2024-02-27

Different. First sentence:

I hope you will enjoy your trip. >>>More

5 answers2024-02-27

For example, if the gateway in the setting of A is a computer in the network of A, connect the network cable of the LAN port of A, connect it to the WAN port of the B router on the 2nd floor (this must be done), and then connect the B router with a computer. Enter the router (note that you can change the machine to the same IP as the router gateway or get it automatically), select the setup wizard after logging in, and select "Static IP (Ethernet Broadband, Network Service Provider Provides Fixed IP Address)" after the next step, and the IP can be changed to any number from 2 to 253) Subnet Mask: Gateway: >>>More

6 answers2024-02-27

True love is not expressed in words, it comes from the heart, when you fall in love with someone, your whole heart will be attracted by the person you love, fascinated by him (her), concerned for him (her), I hope you can see him (her) every minute, when you can't see him, you will always think of him (her), you will be excited when you see it, your heart beats faster, you will feel very warm and safe when you are together, real love for a person will be willing to take care of him (her) care for him (her), give him (her) everything he (she) wants, Seeing that the person you love is happy you will also be happy, and you will be troubled when you see him (her) troubled, but you will do everything you can to make the person you love happy and happy, the real love of a person will want to grow old with him (her), and he (her) will be in love, you will look forward to using all your love to bring him (her) the greatest happiness, and you also get another happiness in this process!! >>>More

11 answers2024-02-27

1. Change Workgroup, My Computer, Right-click Properties, 2nd Item Computer Name Change User Workgroup, Make 2 Computer Workgroups Consistent. >>>More

8 answers2024-02-27

If you install it correctly, go into the system, install the Rubik's Cube Optimization Master, Rubik's Cube Setting Master, System Settings, Multi-System Selection, You can add your other drive letter system, set it down,**You can choose it when you boot it, select it with the up and down keys, enter, you should be able to. Win7 system properties, advanced, boot and failure recovery also have options, you can also take a look at it, hope to solve.