Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on bootstrap : how to align text with a button inside a grid

Post

bootstrap : how to align text with a button inside a grid

+5
−0

I have this bootstrap code (grid)

 <div class="container p-3 center">
        <div class="row">
            <div class="bg-light border-bottom border-secondary border-top col-6 text-center pb-2 pt-2">
                MY HOUSE
            </div>
            <div class="bg-light border-top border-secondary border-bottom border-secondary col-6 text-center text-center pb-2 pt-2">
                <button type="button" class="btn-primary btn-sm">MY CAR</button>
            </div>              
        </div>
    </div>

which returns this

bootstrap button alignment

what should I do to align (vertically) "MY HOUSE" with "MY CAR"?

I tried adding align-middle but it does not work at all.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Perhaps try a grid with two rows... (1 comment)
Perhaps try a grid with two rows...
elgonzo‭ wrote about 2 years ago · edited about 2 years ago

I don't have the faintest clue of all the class identifiers you are throwing around there in your Bootstrap example and what possible CSS definitions they might (or might not) be associated with (heck, i don't even have the slightest experience in Bootstrap to begin with), but could it perhaps be a workable solution for you to define the grid with two rows (one row for each of these 'cells' you want to place vertically underneath each other)?