Guest User

Guest User

  • Tech Writer
  • 103
  • 13.5k

How to use Col-md .

May 21 2021 6:25 AM
Hello everyone I have face a issue .How to use col-md section in foreach loop.I want to divide two section one for blog detail second for blog categories .
 
for e.g
 
multiple bolg display left side and right side blog categories
 
This is my code
  1. <div class="container">  
  2. <div class="row">  
  3. <section class="blog-layout-content">  
  4. @foreach (var blogPost in Model.Items)  
  5. {  
  6. <div class="col-md-10">  
  7. <div class="blog-layout-content--columns-reverse">  
  8. <div class="blog-layout-content__col">  
  9. <article class="blog-post-teaser">  
  10. <header class="blog-post-teaser-header">  
  11. <h2 class="blog-post-teaser-title">  
  12. <a href="@blogPost.FullPath">@blogPost.Title</a>  
  13. </h2>  
  14. <section class="blog-post-teaser-meta">  
  15. <time datetime="">@blogPost.PostDate</time>  
  16. </section>  
  17. </header>  
  18. <section class="blog-post-excerpt">  
  19.   
  20. <p class="card-text">@blogPost.ShortDescription</p>  
  21. <p class="card-text">@blogPost.TestHtml</p>  
  22.   
  23. <div class="blog-post-teaser-read-more">  
  24. <a class="blog-post-teaser-read-more-btn" href="@blogPost.FullPath">Read more </a>  
  25. </div>  
  26. </section>  
  27. </article>  
  28. </div>  
  29. </div>  
  30. </div>  
  31. }  
  32. </section>  
  33. <div id="blog-SidebarCategories">  
  34. @await Component.InvokeAsync("SidebarCategories")  
  35. </div>  
  36. </div>  
  37. </div>

Answers (1)