Arranging two columns side by side for a particular set-up

I am trying to align two columns next to each other instead of stacking them on top of one another. I have adjusted the spacing to ensure there is enough room for them to sit side by side. I have included an image illustrating the positioning I am aiming for, with Object B moving to the new position as indicated.

@model HomeIndexViewModel

@{
    ViewData["Title"] = "Home Page";

}

<div class="container">
    <p class="headerText">Most Recent Movies</p>
    <div class="row">
        <div class="col-lg-10 movieTitleText">
            @foreach (var movie in Model.Movies)
            {
                <div class="col-md-4 movieTitleText">
                    <div>
                        <img src="~/images/@movie.ImageUrl" alt="Visual Studio" class="img-fluid" style="width: 100%; height:100px;" />
                        <h4 class="">@movie.Name <span class="ratingInTitleToRight">☆@movie.Rating</span></h4>
                        <div class="genreTitleTag">@movie.Genre</div>
                        <div class="">@movie.Storyline</div>
                        <a asp-area="" asp-controller="Movie" asp-action="Watchlist" asp-route-id="@movie.Name" class="text-warning genreTitleTag">+ Add to Watchlist</a>
                    </div>
                    @*<partial name="_HomeMoviePartial" model="movie" />*@
                </div>
             }
         </div>
         <div class="col-lg-2">
            <div class="well">
                <p>Place FOR NEWS</p>
            </div>
           <div class="well">
                <p>Place FOR NEWS</p>
            </div>
       </div>
   </div>
</div>


https://i.sstatic.net/9XeZ9.png

Answer №1

Got it! Just add one more to separate the content into new rows.

@model HomeIndexViewModel

@{
    ViewData["Title"] = "Home Page";
}

<div class="container">
    <p class="headerText">Most Recent Movies</p>
    <div class="row">
        <div class="col-lg-10 movieTitleText homeMovieList">
            <div class="row">
                @foreach (var movie in Model.Movies)
                {
                    <div class="col-lg-4 movieTitleText">
                        <div>
                            <img src="~/images/@movie.ImageUrl" alt="Visual Studio" class="img-fluid" style="width: 100%; height:100px;" />
                            <h4 class="">@movie.Name <span class="ratingInTitleToRight">☆@movie.Rating</span></h4>
                            <div class="genreTitleTag">@movie.Genre</div>
                            <div class="storyline">@movie.Storyline</div>
                            <a asp-area="" asp-controller="Movie" asp-action="Watchlist" asp-route-id="@movie.Name" class="text-warning genreTitleTag">+ Add to Watchlist</a>
                        </div>
                    </div>
                }
            </div>
        </div>
        <div class="col-lg-2">
            <div class="well">
                <p>News Section</p>
            </div>
            <div class="well">
                <p>News Section</p>
            </div>
        </div>
    </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Encountering a 'ngRoute' reference issue

My attempt to use a controller to fetch a JSON file is resulting in the following error message: "Failed to instantiate module getJson due to: Error: [$injector:nomod] http://errors.angularjs.org/1.2.23/$injector/nomod?p0=get..." I keep encountering ...

Mastering the art of seamless navigation within a single page through the magic of

I have two HTML pages: "Login.html" and "index.html". Instead of a normal href linking, I want the user to navigate to "index.html" when they click on the login button. Furthermore, I want the index page to be displayed within the codes of login.html, cre ...

How do I use jQuery to animate a height increase where the added height is applied to the top of the element?

I am facing a simple issue that I need help resolving. The problem involves hidden content that, once expanded, needs to have a height of 99px. When collapsed, the container holding this content section#newsletter is set to be 65px in height. If you want ...

The HR element seems to be fixed in place and is not moving

I'm having trouble figuring out what's causing the issue, so I wasn't sure how to title it. Any help in looking at the code would be greatly appreciated. Here is the problem: https://i.sstatic.net/b73CA.jpg The HR tag should be positioned ...

What is the best way to use jQuery to animate a particular height up to 100%?

To provide a sneak peek of the content in the div, I have minimized it so only the first line is visible. Now, I want to add an animation that will expand the div to 100% height when you click the title. However, using animate(height:"100%") does not res ...

Using AJAX to get the response from a static [webmethod] - a guide

On my Default.aspx page, I have the following PageMethod: [WebMethod] public static string Hello() { return "Hello"; } I want to set the text of a div to whatever is returned via AJAX: <div id="ajaxDiv"></div> Below are two methods I us ...

html content area below the text

I'm currently working on developing a mobile webpage using jQuery Mobile. Encountering some peculiar behavior with text inside a div or table cell that has a background color. It seems to have some extra whitespace below the characters, making it app ...

What could be the reason for the container div's height not being properly refreshed?

When adding elements to a container div with an initial height of 'auto', I assumed that the height would adjust based on the children elements added. However, this is not happening. Can anyone assist me in ensuring that the container div's ...

Is there a way to display (PHP for loop variables) within an HTML table using echo?

for ($q = 1 ; $q < 7 ; $q++ ) { echo $q ; echo $row; } While the above code functions properly, I am interested in echoing two rows as shown in the image below: https://i.stack.imgur.com/7KmUY.jpg I prefer not to use another for loop. Is there a way t ...

Change the type of field from a div to an input when clicked

I'm trying to achieve something unique with a div on my webpage. When the user clicks on it, I want the div to transform into an input field. Initially, the div looks like this: <div>This is the content.</div> But when clicked, I want i ...

Leveraging the power of Required (html5) feature in Internet Explorer

What should I do if I want to make a textbox required on my webpage, but the issue is that it uses an HTML5 attribute? Is there a solution or alternative available? This is how I create my TextBox: @Html.TextBoxFor(model => model.SubChoiceText, new { ...

Maximizing the potential of image srcset in HTML5

After configuring the img srcset as shown below: <img srcset="http://via.placeholder.com/320x150 320w, http://via.placeholder.com/480x150 480w, http://via.placeholder.com/800x150 800w" src="http://via.placeholder.com/8 ...

Php Error 404 occurs upon attempting to redirect from the main landing page

I have been encountering an issue while trying to add links to different pages of my website. Whenever I click on the link, it displays a "404 Page Not Found" error message. Objective: My main goal is to create links from my home page, index.php, to other ...

Tips for transferring a variable from a hyperlink to a Flask application

Here is a snippet of my Python Flask code: @app.route('/ques/<string:idd>',methods=['GET', 'POST']) def ques(idd): print(id) And here is the accompanying Javascript code: var counts = {{ test|tojson }}; var text = ...

<ul><li>issue with indentation

Is there a way to eliminate the indent from my unordered list? While inspecting the element, I noticed what appears to be padding between the width of the box and the content. However, setting padding to 0px and margin to 0px doesn't seem to work as t ...

Trying to extract data from the ASX website's table using web scraping techniques

My goal is to extract the current stock value from the ASX.com.au website. Specifically, I am interested in retrieving the current ASX value, which can be located here. The value I am looking for is in the second td from the left, currently standing at 30 ...

Presenting JSON data in a table format on-the-fly even without prior knowledge of the data's structure or field names

When working with my application, I will be receiving data in JSON format and I am looking to showcase this data in a tabular form within a web browser. It's important to mention that I won't know beforehand the structure or field names of the re ...

Tips on altering hover effects?

I am having trouble changing the font size and color of the a when hovering over p. I have been trying to figure this out for a while now, but I can't seem to get it to work. If anyone has any simple links related to this topic, I would greatly appre ...

Locate numbers 2, 3, 6, 7, and 10, and continue in numerical order, within the

Having trouble with this one. Does anyone know how to display the items like this: 2, 3, 6, 7, 10 and so on... Is there a jQuery or CSS hack that can achieve this? I'm stuck trying to figure it out .container { display: flex; flex-flow: row wra ...

Tap on the Dropdown Menu to access the Responsive design feature

Currently, I am working on perfecting a responsive navigation menu. My goal is to have the drop-down menu appear when the menu icon is clicked, as opposed to the hover effect. I am utilizing a Google jQuery script, but I am unsure if the drop-down functi ...